I have a page that has the following php:
<?php
$mail = $_GET["mail"];
if ($mail == "true"){
echo '<script type="text/javascript">alert("Mail sent successfully! Check your inbox!");</script>';
}
if ($mail == "false"){
echo '<script type="text/javascript">alert("Mail sending failed, please try again later :<");</script>';
}
?>
It’s index.php that only gets that variable from a mail sending php.
Problem is I had to put it at the end of body so the body loads first (and thus the alert pop-up doesn’t show on a white background), but images doesn’t load first and, after I click “ok” in the alert window, they load awfully slow (so I think they start loading after a while). Why could this be?
Perhaps you should wait for the whole page to load before making an alert.
See here.