I’m making a JSON-P request to an API via jQuery AJAX
$('#fetch').click(function(){
$.ajax({
url: 'http://abettertms.com/api2/terms',
dataType: 'jsonp',
success: function(){
console.log("success");
},
error: function() { console.log('error'); }
});
});
Debugging using the Chrome console shows the ajax request is made to
http://abettertms.com/api2/terms?callback=jQuery1710946886689402163_1328157759295&_=1328157761647
with the extra parameter &_=1328157761647. Why is jQuery adding that? The API I’m calling is my own, so in a crunch I can edit the API to ignore the extraneous parameter, but I’d prefer not having to resort to that.
Cache
Default: true, false for dataType ‘script’ and ‘jsonp’
If set to false, it will force requested pages not to be cached by the browser. Setting cache to false also appends a query string parameter, “_=[TIMESTAMP]”, to the URL.
See cache param in following link.
Ref: jquery ajax