1.

How to handle errors in an ajax request ?

Answer»

Jquery.AJAX() method contains a setting called “cache”, by default it TAKES true and false for ‘script’ and ‘jsonp’. If set it to false, it will force request not to be cached by the browser. It WORKS by appending timestamp to the parameters.

The following is the syntax:

$.ajax({ URL: "test.html", cache: false }) .done(function( html ) {   $( "#results" ).append( html ); });  

The above code always loads test.html from the server but never gets loaded from the browser cache.



Discussion

No Comment Found