loll Posted June 23, 2007 Share Posted June 23, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/56803-ajax-redirect/ Share on other sites More sharing options...
kathas Posted June 25, 2007 Share Posted June 25, 2007 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 = "") Quote Link to comment https://forums.phpfreaks.com/topic/56803-ajax-redirect/#findComment-282377 Share on other sites More sharing options...
pocobueno1388 Posted July 1, 2007 Share Posted July 1, 2007 I thought the javascript command to redirect was: window.location = "www.url.com" Maybe it can be done both ways? Quote Link to comment https://forums.phpfreaks.com/topic/56803-ajax-redirect/#findComment-287375 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.