Jump to content

Ajax redirect


loll

Recommended Posts

I have an ajax page that monitors the state of a page. I use PHP to do the monitoring and use ajax to update the pages message depending on if the state has changed

 

On one state I want to to redirect to a totally new page, away from the page that is running ajax.

 

In my php code im trying to use "header("location.... etc

 

however while it does redirect, it stays in the ajax model. so I am trying to find a way from my php to break away from the ajax page.

 

I know in general this in some ways defeats the purpose of ajax, but for my use, it works for what i need. If there another way to break out of the ajax page without the user having to click a button or a link?

Link to comment
Share on other sites

you never thought redirecting with JavaScript? or meta-redirects?

 

You can't break out of Ajax the way you think of it... Internet is just requests and responses... you can't request a page with an Ajax request and have the browser receive the response directly... Simply redirect them with JavaScript....! (document.location = "")

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.