I'm seeing some strange behaviour on a web page... I have included jQuery (and jQuery UI) using regular script tags. When the page loads I see that the file is loaded (from the local browser cache as there are far-future Expires headers on the file).
However, it seems that jQuery itself initiates a new network request to fetch itself again, including a random parameter value which causes the file to download (ie not use the cached version).
A screenshot from Chrome's network tab:
This is very strange... what is happening here ?
UPDATE: The code that is triggering this behaviour is the following:
$(window).load(function() {
$("#t20ContentRightWrapper").toggle("slide", { direction: "right" }, 400);
});
If I change it to this instead, the "double-loading" goes away:
$(window).load(function() {
$("#t20ContentRightWrapper").toggle("fade", 400);
});
So basically, when I'm using the "slide" animation, jQuery and jQuery UI get reloaded with extra network requests, while using the "fade" animation does not.
I want to use the "slide" animation so I need to know what's going on here... !
UPDATE 2: Here's a screenshot that shows the call stack when hovering over the "Initiator" script in Chrome:
You might also try
$(function() {
$("#t20ContentRightWrapper").toggle("slide", { direction: "right" }, 400);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With