Page 1 of 1

messagebox javascipt problem

Posted: Tue Mar 10, 2009 10:18 pm
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

Re: messagebox javascipt problem

Posted: Fri Mar 13, 2009 8:57 pm
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?