Friday, November 11, 2011
When jQuery $.ajax() keeps returning the same value on Internet Explorer
I just mentioned this in my last post, but it is important enough that I'm going to give it its own post!
If you have jQuery Ajax calls, such as $.ajax() , $.get(), etc., that are continually fetching data from a remote server, you may find this works on Firefox, Chrome, etc. but in Internet Explorer it keeps returning the same value.
IE has cached the first return value and thinks that you are making identical requests so it just uses the cached value and never contacts the server.
Turn off caching by adding a call to ajaxSetup at the start of your script block and set cache to false.
The fix is simple once you realize it but it took me a while to figure it out this morning.
Archive of Tips
- ► 2013 (26)
- ► 2012 (28)
- strsplit in R
- Running R scripts on the Command Line
- Deleting a File that starts with '-' on UNIX
- Plotting a simple bar plot in R
- Captain Beefheart Song Titles
- When jQuery $.ajax() keeps returning the same valu...
- Updating a DIV with jQuery and Sinatra
- Latest version of jQuery on Google APIs
- Sorting on multiple String keys in Ruby
- Manipulating Model/Table/Controller Names in Rails...
- Parsing 96 / 384 well Plate Maps
- ▼ November (11)
- ► 2010 (40)
- ► 2009 (53)
- ► 2008 (21)