Networking, Programming and Graphics Tutorials

Disable caching in AJAX [2/2]

And now we can add this new value of time to the AJAX URL to get unique URL each time when AJAX script make request to the server side script.

var url='ajax.php?data='+str;
var date = new Date();
var timestamp = date.getTime();
url=url+'&time='+timestamp;
Please note that you have to get current time each time when you prepare to make each AJAX request. If you get time from current date in the beginning of script and later you want to use the value from this variable you will get identically values for time and your AJAX URLs.

For more explanation how AJAX work and how to use it you can visit our AJAX section of tutorials and to meet with AJAX features and possibilities.

Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - Disable caching in AJAX [2/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: disable caching in php ajax  disable ajax caching  ajax disable caching  disable caching in ajax call  disable caching AJAX requests  ajax caching  php ajax caching  php + ajax + caching  caching ajax php  caching+ajax