[jQuery] ajax, scripts and bowser cache
Hi
I submit data to a page and load response content into a div using an
ajax POST request.
The response can contain new scripts to load and some which have been
already loaded by the main page. The browser does not sort out
already loaded/cached scripts because jquery adds an additional flag
to the url which looks like '&_=1236778004669'. This is also the case
if I define the "cache: true," parameter.
This is what my ajax function looks like:
$.ajax({
type: "POST",
url: "SomeUrl",
cache: true,
data: postData,
success: function(html,status){}
});
The response from server to this is something like:
<script type="text/javascript" src="JSJQuery7i/jquery.js;></script>
Some Content SomeContent
With Firebug I can see that now an additional request is beeing
processed:
http://localhost/JSJQuery/jquery.js&_=1236778003896
Although the script has been already loaded/cached