JQuery caching in IE

We have a website here using the Wufoo form and the jQuery Wufoo API.

We extract data from the API, sort it, and then display it on the page. When we submit the form with a number higher than the current current 10, it should be updated in real time on the right side, as the form redirects back to itself. He does this, but not in IE. Instead, there is an unwanted lag between form submission and new data. Closing the browser and reopening the page seems to work, but that doesn't help.

Here is the jQuery we use:

<script> $.wufooAPI.getEntries({ "callback" : processEntries, "formHash" : "x7x1x7", "sortID" : "Field3", "sortDirection" : "DESC", }); function processEntries(data) { $.each(data.Entries.slice(0, 10), function(entriesIndex, entriesObject) { // Make sure this entry has all the required bits if (entriesObject.Field1 && entriesObject.Field3) { $("#attendeeTemplate").tmpl(entriesObject).appendTo("#people ul"); } }); }; </script> 

And here is the template code:

  <script id="attendeeTemplate" type="text/x-jquery-tmpl"> <li> <h4>${Field1}</h4> ${Field3} minutes </li> </script> 

It works fine in all browsers except IE8 and 9, when it looks like data caching and does not pull the request from the server.

Is there a way to stop jQuery caching in IE?

+7
source share
1 answer

An easy way is to trick and salt the url of your request with a timestamp (but this is a bit awkward). You can disable caching for ajax requests :

 $.ajaxSetup ({ // Disable caching of AJAX responses cache: false }); 

MSDN has a page about avoiding cache in IE http://support.microsoft.com/kb/234067 .

+20
source

All Articles