Good afternoon!
I run the plugin on jQuery 1.4.4 s getJSON(), after upgrading to 1.5, callback is not called. The returned JSON is valid (I checked with a validator).
I also noticed an extra get parameter ?callback=...that jQuery adds to the URL
I seem to understand how to create a test case, and it seems that the reason is JQuery validate 1.7 (latest version):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru">
<head>
<title>
</title>
<meta http-equiv="content-type" content="text/html; charset=utf8" />
<script type="text/javascript" src="js/jquery-1.5.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
$.ajaxSetup({ cache: false });
$('#clickme').click(function(){
var params = {userid : 'some-user-id-to-choose-right-temp-FTP-folder-for-the-user'};
$.getJSON('/ajax-page_material-edit-ftp-filelist.php', params, function(data) {
console.log(data);
});
});
});
</script>
<a href="#" id="clickme">Click Me!</a>
</body>
</html>
Perhaps this code in the plugin is the reason:
;(function($) {
var ajax = $.ajax;
var pendingRequests = {};
$.ajax = function(settings) {
settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings));
var port = settings.port;
if (settings.mode == "abort") {
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
return (pendingRequests[port] = ajax.apply(this, arguments));
}
return ajax.apply(this, arguments);
};
})(jQuery);
source
share