url (default: The current page) Type: String A string containing the URL to which the request is sent. Each function will be called in turn. Notice the success, error and complete settings. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. my review here
For more information on JSONP, see the original post detailing its use. The async option to $.ajax() defaults to true, indicating that code execution can continue after the request is made. This functionality can be added to older browsers using the json2.js library. Default value is false, ignoring the header.
You could test if this is what's happening by putting the entire contents of display_counts in a try..catch block. i wonder if jquery would throw an error if it is expecting json (dataType: "json") and doesn't get any return data. Normally jQuery handles the creation of this object internally, but a custom function for manufacturing one can be specified using the xhr option. $.ajax Example To differentiate between the requests, use the parameters passed to the handler.
In the second form, the URL is specified in the options parameter, or can be omitted in which case the request is made to the current page. Jquery Ajax Post is it the same for now?? –mfadel Jan 16 '13 at 11:44 1 @mfadel: Some older browsers don't support JSON, so using a third-party parser in the first-place could prevent Besides, for very simple cases like those I've shown in the article I prefer to stick with the callbacks. cache (default: true, false for dataType 'script' and 'jsonp') Type: Boolean If set to false, it will force requested pages not to be cached by the browser.