Tagged Questions
1574
votes
47answers
551k views
How can I get query string values?
Is there a plugin-less way of retrieving query string values via jQuery (or without)?
If so, how, and if not what plugin do you recommend?
70
votes
2answers
5k views
How to return the response from an AJAX call?
I have a function foo with makes an AJAX request. How can I return the response from foo?
I tried to return the value from the success callback as well as assigning the response to a local variable ...
504
votes
6answers
69k views
.prop() vs .attr()
Ok.
So jQuery 1.6 has the new function prop().
$(selector).click(function(){
//instead of:
this.getAttribute('style');
//do i use:
$(this).prop('style');
//or:
...
664
votes
8answers
156k views
event.preventDefault() vs. return false
When I want to prevent other event handlers from executing after a certain event is fired, I can use one of two techniques. I'll use jQuery in the examples, but this applies to plain-JS as well:
#1 ...
39
votes
1answer
12k views
jQuery Mobile: document ready vs page events
I am using JQuery Mobile and I am having trouble understanding difference between classic document ready and jQuery Mobile page events.
Can someone tell me what is a real difference?
Why should
...
453
votes
6answers
122k views
Abort Ajax requests using jQuery
Using jQuery, how can I cancel/abort an Ajax request that I have not yet received the response from?
270
votes
9answers
331k views
XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin
I'm developing a page that pulls images from Flickr and Panoramio via jQuery's AJAX support.
The Flickr side is working fine, but when I try to $.get(url, callback) from Panoramio, I see an error in ...
299
votes
17answers
172k views
Preloading images with jQuery
I'm looking for a quick and easy way to preload images with JavaScript. I'm using jQuery if that's important.
I saw this here (http://nettuts.com...):
function complexLoad(config, fileNames) {
for ...
1366
votes
12answers
686k views
How can I make a redirect page in jQuery/JavaScript?
How can I redirect the user from one page to another using jQuery?
251
votes
9answers
216k views
jQuery/JavaScript: accessing contents of an iframe
I would like to manipulate the html inside an iframe using jquery.
I thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like:
...
446
votes
11answers
356k views
Serializing to JSON in jQuery
I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this?
My specific situation: I have an array defined something like this:
var countries = new Array();
...
166
votes
8answers
53k views
How do I select text nodes with jQuery?
I would like to get all descendant text nodes of an element, as a jQuery collection. What is the best way to do that?
59
votes
7answers
130k views
jQuery Ajax File Upload
Can I use this following jQuery code to perform file upload using post method of Ajax request ?
$.ajax({
type: "POST",
timeout: 50000,
url: url,
data: dataString,
success: ...
173
votes
14answers
197k views
Get URL parameter with jQuery
I'm looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: "malformed URI sequence". If there isn't a jQuery plugin that ...
240
votes
10answers
167k views
JavaScript/jQuery HTML Encoding
I'm using Javascript to pull a value out from a hidden field and display it on a textbox
The value in the hidden field is encoded.
e.g.
<input id='hiddenId' type='hidden' value='chalk & ...