messagebox javascipt problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
greedyisg00d
Forum Commoner
Posts: 42
Joined: Thu Feb 12, 2009 2:48 am

messagebox javascipt problem

Post by greedyisg00d »

When the javascript messagebox pops out, my page display becomes unorganized or half of the content is loaded only but when I click ok in the messagebox and redirect it to another page everything returns to normal again. Any idea what is the problem? Here is my code

Code: Select all

echo "<script type='text/javascript'> window.alert('Schedule successfully added'); window.location='schedulelist.php'; </script>";
 

Thanks
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: messagebox javascipt problem

Post by Benjamin »

Loading probably halts until the user clicks on the alert. Try putting it at the bottom of the page or use an onload event. I don't know why programmers do this. Why not just display the message on the page?
Post Reply