PDA

View Full Version : Ajax error



weblexie
05-27-2011, 08:33 AM
Hi everyone!

I am having trouble here, I am using this ajax script to load my php files,

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

But I having trouble redirecting to another page.

example of redirection I am using:

<script type='text/javascript'> window.location = 'index.php' </script>
and

header("Location: index.php");

but it won't redirect.

Please help me guys. Thanks!

jscheuer1
05-27-2011, 03:31 PM
Scripts on imported content won't fire. A PHP header redirect should. Unless of course it's syntactically incorrect for some reason.

Which page are you trying to redirect, the imported page or the 'top' page? And why? If you want to import a certain page, just import that, don't redirect to it. If you want to redirect the top page, just do so, don't involve AJAX in it.