echo php javascript alert?
- by Anaes Arias
How can I echo this javascript if the php error messages is called? I have an error message setting that when a user misses his username or password it triggers an error message. The php error message is called by a php code. Here is the code:
<?php echo showmessage($msg) ?>
I have an alert message in javascript that when called it will make a javascript css pop up alert box. IF the javascript code is present it will show the alert box right away after reload. Here is code:
<script type="text/javascript">
$(document).ready(function () {
jqxAlert.alert('Alert Message');
})
</script>
How can I incorporate so that when the php echo message comes up it will trigger the javscript alert message. I was trying an if in php, so something like this code:
if ( showmessage($msg) ) {
<script type="text/javascript">
$(document).ready(function () {
jqxAlert.alert('Alert Message');
})
</script>
}
How can I echo my javascript message on the php call?