jquery

Screen readers and Javascript

余生颓废 提交于 2021-02-18 10:15:03
问题 I'm creating a website for a reading service for the blind and visually impaired and I'm using JavaScript (with jQuery) to print some stuff to some of the pages after the page has loaded. Will the screen reader read the content that is printed to the page with jquery after the page has been loaded? From this page - "Generally, [screen readers] access the DOM (Document Object Model), and they use browser APIs (Application Programming Interfaces) to get the information they need." and we know

How do I get a multi-page pdf from a website using jsPDF and HTML2Canvas?

早过忘川 提交于 2021-02-18 09:58:11
问题 I have a script that uses HTML2Canvas to take a screenshot of a div within the page, and then converts it to a pdf using jsPDF. The problem is the pdf that is generated is only one page, and the screenshot requires more than one page in some instances. For example the screenshot is larger than 8.5x11. The width is fine, but I need it to create more than one page to fit the entire screenshot. Here is my script: var pdf = new jsPDF('portrait', 'pt', 'letter'); $('.export').click(function() {

Get the value of the radio button that was selected before the user selects a new one

谁都会走 提交于 2021-02-18 09:34:14
问题 If I have 3 radio buttons, is there a way through jQuery of finding out the value of the one that was selected before the user clicks a new one? <div id="radio-group"> <input type="radio" id="radio-1" name="radios" value="1" checked="true" /> <input type="radio" id="radio-2" name="radios" value="2" /> <input type="radio" id="radio-3" name="radios" value="3" /> </div> In the example avove, if the user clicks on radio-3 , I need a way to get 1 , so that I can carry out some formattion to it.

Get the value of the radio button that was selected before the user selects a new one

試著忘記壹切 提交于 2021-02-18 09:32:11
问题 If I have 3 radio buttons, is there a way through jQuery of finding out the value of the one that was selected before the user clicks a new one? <div id="radio-group"> <input type="radio" id="radio-1" name="radios" value="1" checked="true" /> <input type="radio" id="radio-2" name="radios" value="2" /> <input type="radio" id="radio-3" name="radios" value="3" /> </div> In the example avove, if the user clicks on radio-3 , I need a way to get 1 , so that I can carry out some formattion to it.

Get the value of the radio button that was selected before the user selects a new one

百般思念 提交于 2021-02-18 09:31:11
问题 If I have 3 radio buttons, is there a way through jQuery of finding out the value of the one that was selected before the user clicks a new one? <div id="radio-group"> <input type="radio" id="radio-1" name="radios" value="1" checked="true" /> <input type="radio" id="radio-2" name="radios" value="2" /> <input type="radio" id="radio-3" name="radios" value="3" /> </div> In the example avove, if the user clicks on radio-3 , I need a way to get 1 , so that I can carry out some formattion to it.

if (function() === false){ do this}

只愿长相守 提交于 2021-02-18 08:29:21
问题 i'm trying to solve this issue, i'm relatively new to javascript, so: function termos() gives a true or false result; probably the solution to this is simple, but can't get to it. Is it possible to do this? i wrote this code just to exemplify my doubt function termos() { if($('.terms').is(':checked')) { return true; } else { return false; } } can i use } else if(termos() === false) { alert('please agree with terms'); return false; } This doesn't work 回答1: From what I understand you want to

Jenkins json REST api with CORS request using jQuery

给你一囗甜甜゛ 提交于 2021-02-18 08:13:55
问题 I'm trying to use the Jenkins json API and cannot get the authentication to work. setup: Jenkins security: Jenkin’s own user database access: Matrix-gebaseerde beveiliging CORS via Jenkins CORS plugin using username/api token of a registered user tried: var username = "username"; var apiToken = "apiToken"; // username / api-token on url (basic authentication) $.ajax({ url: "http://"+username+":"+apiToken+"@host:port/job/test/api/json", method: "GET" }); // username / api-token supplied using

jQuery validate not working properly

放肆的年华 提交于 2021-02-18 08:08:24
问题 I need this validation to fire when the div button is clicked. If the validation is successful, I want it to alert "is good". Unfortunately, although validation fires and all rules are checked, it does not error if a required field is blank. It will error for any of the other checks tho. Finally, if I fill in the fields correctly and click the button, nothing happens. JS: $(document).ready(function() { // Submit prompted password reset $("#passwordResetButton").click(function() { $("

jquery validate errorplacement with a specific place

别来无恙 提交于 2021-02-18 07:44:25
问题 i want to validate my form with jquery validate but i want to put my error label to a specific place. an example below show error label put in the <span class="error_label"></span> . my question is how can i make errorplacement with a specific place, with an example below, please help me..thanks? <script> $(document).ready(function (){ $("#fm_regis").validate({ rules :{ name: { required: true, }, }, errorPlacement: function(error, element) { //$(element).next('span .error_label :first').html

Preloading huge amount of images

我的未来我决定 提交于 2021-02-18 07:39:54
问题 I'm trying to do a parallel preload of images using the logic implemented on the below link. http://blog.lieldulev.com/2010/05/21/parallel-image-preloading-in-js/ I have a huge amount of images, currently 350+ images with an average of 50KB file size each, amounting to a total of 20MB of images im trying to preload. I need the images for canvas drawing. Using the above logic of parallel downloading, I'm having issues of the browser waiting for 2mins to finish loading the whole page. sometimes