> I'm new to the group and to JQuery, but am currently reading and
> writing a review of JQuery in Action. I have an interesting problem;
> I'm hoping someone can help me with it.
>
> I have a form that posts to a server. When the post executes, it
> always receives a redirect. What I want to do is capture that
> redirect, determine whether it is an HTML page or a PDF document. If
> it is an HTML page, I want to display it in the same window/tab. If a
> PDF document, I want to change the target for the GET (the redirect)
> to "_blank" (a new window/tab).
>
> I'm afraid that so much of ajaxSubmit is wrapped up that I cannot get
> access to what I need. I don't even know if JQuery will allow me not
> to follow redirects - I don't see any API for this, but I'm likely
> missing something.
>
> Any ideas?
>
> Thanks!
>
> David Sills


This doesn't really have anything to do with ajaxSubmit.  You're
talking about capturing a redirect from the server but the
XMLHttpRequest object will automatically follow a redirect.  The
response you end up with will be whatever is at the redirect
location.  Essentially the redir works the same as if you had
requested the page without ajax, except the main window location for
the browser will not change when the request is made via ajax.

Mike

Reply via email to