1
1
|
jQuery: How to enable
beforeSend for $.ajax({dataType:'jsonp'... ? Is there any solution?http://jsfiddle.net/laukstein/2wcpU/
| |||
add comment |
4
|
This is just the nature of how JSONP works, creating a
tag, not actually using aXMLHttpRequest to get data. For what you're doing, you can just run the code before, like this:
| ||
add comment |
4
| As per jQuery documentation
The same question is asked at the jQuery forums
The question's status is And as Mike Alsups noted
Also related : Cannot use beforeSend with jsonp. Period. | ||
add comment |
1
| you can use this code: befor $.ajax put it, and you should have an image(or div,span ,...) loading with "div_loading" id.
| ||
add comment |
jQuery(document).ajaxStart(function(){$('#content').html('Loading...')})
? – Binyamin Jan 12 '11 at 20:09$('#content').ajaxStart(function() { $(this).html('Loading...'); });
:) – Nick Craver♦ Jan 12 '11 at 20:34