Once I was stuck in a very bothering problem, I was sending an AJAX request to the same URL (a PHP script) on and on. It worked fine in FF and Opera, the things were getting updated as I expected. But IE showed some bothering behavior. Since I was sending request to the same URL, IE was not allowing AJAX to send request to the actual URL rather it was retrieving the responses from its cache. So the things were not getting updated as I was expecting. I googled and found out solution to this problem. I found the following solution from googling.
You need to force no caching by adding the following lines just before you call xhr.send(null), where xhr is the XMLHTTPRequest.
xhr.setRequestHeader(“If-Modified-Since”, “Thu, 1 Jan 1970 00:00:00 GMT”);
xhr.setRequestHeader(“Cache-Control”, “no-cache”);
I also devised another way. Since the problem is due to the same URL, we can change the URL by adding some random number which makes the URL look different each time it is used and it doen’t affect the URL. The following is another solution.
xhr.open(“GET”, “http://my-address/myscript?myparam=dummy&rand=” + Math.random(), true);