[jQuery] Re: Display fails when jQuery.js isn’t ca ched. When cached, page displayed OK.

2009-10-13 Thread Michael Geary
You may be mistaking cause and effect.

The ?_=1255309685187 query string isn't a token to specify how long
something should be cached. It's a random number used as a "cachebuster"
when jQuery makes an Ajax request. Adding the random number to the URL makes
it a different URL each time, so the browser has to request a fresh copy of
the file.

So it seems likely that the presence of this query string is forcing the 200
status, not the other way around.

But as I mentioned in my other reply, none of this should be happening if
you load jquery-*.js with a 

[jQuery] Re: Display fails when jQuery.js isn’t ca ched. When cached, page displayed OK.

2009-10-12 Thread Lance May

Bob,
 Working on quite a bit of jQuery AJAX over the past week or so,
I've noticed similar side-effects. I have no idea if my issues are
related to yours, but 90% of my problems were solved by using the
callbacks instead of expecting that linear execution would be fine
with the few things I was trying to call. Since I've stopped trying to
do anything but AJAX calls where I do them (and started using other
callbacks for things like .animate and the like), I've had nothing but
clean loading pages. Again, I doubt the issues are related, but the
symptom is at least identical. ;)

- Lance

On Oct 11, 9:42 pm, Bob  wrote:
> I have jQuery UI Tabs which load their content via AJAX. About once
> every 15 times when the entire page is loaded (not just XHR), things
> fail and I don't see the proper content in the tab.  The jQuery
> executes without error, but the page display is wrong.
>
> Fiddler showed me that when things fail I also see that jQuery.js and
> jQuery-ui.js are both sent to the browser in full (~100kB). Normally,
> a page load results in HTTP status code 304 for both of those files,
> they're not re-downloaded, and the page displays properly. When the
> status code is 200 and fresh copies of jQuery/UI are sent, things
> fail.
>
> I notice this most often in IE8, but that's because I use it for web
> development. I have seen it in Firefox, but for some reason I can't
> reproduce it now.
>
> Fiddler shows that the HTTP request asks for:
>
>     GET /Scripts/jquery-1.3.2.min.js?_=1255309685187 HTTP/1.1
>
> I can't figure out what the ?_=1255309685187 is for, but I'm guessing
> it's a token to indicate for how long the file should be cached.
>
> Since I can't reproduce the problem in Firefox right now, I don't know
> what Firebug says.
>
> Any insight would be appreciated.