just out of curiosity, have you checked to make sure you aren't using
the $.ajax() method (or one of its convenience methods) elsewhere? i
see in the first set of headers that the "X-Requested-With" header is
present, which is generally added by jQuery (and most other libs) when
a request is submitted via XHR. so, the first request is being
submitted via ajax, and the second request is not. is this
intentional?

also, just a note that $.getScript() is generally used to make cross-
domain calls (which are not allowed in XHR), so if the resource is on
the same domain i'd recommend scrapping the $.getScript() call and
replacing it with an $.ajax() call.

of course, as michael suggested, a test page would get us all much
closer to the answer :)

On Nov 24, 4:19 pm, Michael Geary <m...@mg.to> wrote:
> Can you post a link to a test page?
>
> Pretty hard to troubleshoot by just looking at the headers.
>
> Of course, someone will come along and troubleshoot it from the headers
> alone and prove me wrong! :-)
>
> -Mike
>
> On Tue, Nov 24, 2009 at 6:50 AM, Eric <ikeah...@gmail.com> wrote:
> > Hey there,
>
> > A $.getScript() call I am making results in two seperate requests to
> > the server. Any chance I can avoid that?
>
> > Here are the headers:
>
> > GET server.file?param1=param2 HTTP/1.1
> > Host: server
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.8.1.20)
> > Gecko/20081217 Firefox/2.0.0.20
> > Accept: text/javascript, application/javascript, */*
> > Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
> > Accept-Encoding: gzip,deflate
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > Keep-Alive: 300
> > Connection: keep-alive
> > X-Requested-With: XMLHttpRequest
> > Referer:http://server/indexfile.html
> > Cookie: (Cookie Contents)
>
> > Followed by...
>
> > GET server.file?param1=param2 HTTP/1.1
> > Host: server
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.8.1.20)
> > Gecko/20081217 Firefox/2.0.0.20
> > Accept: text/xml,application/xml,application/xhtml+xml,text/
> > html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> > Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
> > Accept-Encoding: gzip,deflate
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > Keep-Alive: 300
> > Connection: keep-alive
> > Cookie: (Cookie Contents)
>
> > The web server runs IIS6.
>
> > Thanks for your help
> > Eric

Reply via email to