RSS

Category Archives: ajax

[ajax][IE][tip] ajax functions show random behaviour in IE and works fine in all other browsers

IE needs special care while designing css and scripting js/ajax. Once while using sortable function and updating db as per latest sorting i get random behavior of IE as compare to other browsers (Firefox, Chrome etc). On first move the html element got sorted but is not updated in db; and for all moves-other than the first one-it works fine.
After debugging the issue for hours i was just like…

Stucked

Stucked

Then i ‘Delete Browser History’ and thus it works perfectly fine for all moves even for FIRST ONE. Following are the screenshots illustrating the ‘Delete Browser History’ process

Delete Browser History

Delete Browser History

Delete

Delete

Thanks to ‘Delete Browser History’ option 🙂

Later on, I found How to solve Internet Explorer cache issue in Ajax .

When you call the method:

http.open

add a random variable using Math object and add it in the method’s URL argument, for example:

nocache = Math.random();
http.open('get','page.php?url_parameter='+
parameter+'&nocache ='+nocache);
In this way all the new request will have an URL parameter (&nocache) which force the browser to “refresh” the old value with the new value.
 
4 Comments

Posted by on December 24, 2011 in ajax

 

Tags: , , , , , , , , , ,

 
%d bloggers like this: