jQuery: The Write Less, Do More JavaScript Library

Talk:Ajax/jQuery.getScript

From jQuery JavaScript Library

Jump to: navigation, search

This is a very useful function, but I ran into caching issues with Internet Explorer.

I have a function that calls getScript(). It is wrapped in a setInterval() to execute every minute. The problem is that after the first retrieval, IE wasn't fetching the script anymore. It was already cached so it just served up the cached response.

The solution was to serve up the getScript() response with the appropriate headers that instructed IE to not cache the file. Unfortunately, it took me a few hours to figure that out.

-- James