Javascript in iframe that loads a PHP and redirects is not executed
I have this PHP code:
<?php
/*
DOING SOME PHP STUFF THAT WORKS HERE
*/
echo "<script type=\"text/javascript\">
alert('test1');
</script>";
header("Location: index.php");
?>
This php page is loaded within an iframe. The redirect works OK but the
javascript is not executed. My guess is that the server doesn't send the
HTML of this page but just executes the PHP code and then sends the
redirect HTML.
Can I make the javascript execute first and then redirect?
No comments:
Post a Comment