tags:

views:

42

answers:

3

Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).

AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.

Everything is working fine, except when I use Internet Explorer 8.0 .

There are several php scripts, which allow for the data to be ordered according to certain criteria, and for testing purposes I have attached the mktime field (current time, in the format HH:MM:SS) to the beginning of the results for each query. When I use IE, these times appear to remain constant, whereas with ALL other browsers these times are correct and display the current time.

I think the issue has something to do with caching or something along those lines anyway.

Any thoughts or suggestions welcome...

+2  A: 

Here is an article on the caching issue.

If your request is a GET change it to a POST, this will prevent the results being cached.

Fermin
Updated post with article link. Sorry about that!
Fermin
+1  A: 

GET requests are cached in IE; switch it to a POST request and it won't be cached anymore.

peterp
+1  A: 

Instead of switching to POST, which can be ugly if you're not really using it to update or create content, you should append a random number to the query string, as in http://domain.com/ajax/some-request?r=123456. If this number is unique for every request you won't have caching problems.

Htbaa