Display an alert error with php and javascript not working properly in FF and Chrome -
i use piece of code inform user fill field in way:
ob_start(); $msg = $_session['erroruser']; if($msg !=""){ echo '<script type="text/javascript">alert(" ' . $msg . '");</script>'; } //echo $msg; $_session['erroruser'] = ""; ob_end_flush();
this works in internet explorer while in ff , chrome. msg displayed, have nothing in background, part of page showed (behind message alert).
the problem you're facing outputting alert straight dom cause alert triggered while dom still loading. if you're using jquery should output alert box inside jquery(document).ready
callback or otherwise bind load
/domcontentready
events of window object.
Comments
Post a Comment