This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Mozilla XML > August 2005 > Intercepting redirects in XMLHttpRequest





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Intercepting redirects in XMLHttpRequest
Milamber³

2005-08-08, 7:34 pm

Hi all,

I am trying to write an extension that makes use of XMLHttpRequest - the
reason I want to use this is because I need to send extra headers to the
server when I make the requests. Occasionally, the reply will be a 302
redirect which I want to intercept and make the current window navigate to
that url. I can't see any way of doing this.

I am sure that there is something I am missing. If anyone knows of a way to
do this - ideally so that I can get the header of the redirect (there will
be other information in the header that woiuld be useful for me) then I
would be really grateful.

Cheers,

Milamber³


Heikki Toivonen

2005-08-08, 11:20 pm

> I am trying to write an extension that makes use of XMLHttpRequest - the
> reason I want to use this is because I need to send extra headers to the
> server when I make the requests. Occasionally, the reply will be a 302
> redirect which I want to intercept and make the current window navigate to
> that url. I can't see any way of doing this.


XMLHttpRequest will automatically follow redirects. So I guess in your
situation you need a way to figure out from the returned data if there
was a redirect and then navigate the current window if so.

--
Heikki Toivonen
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews