PHP Function to call up Javascript Alert


/ Published in: PHP
Save to your folder(s)

This is to call up Javascript alert through PHP. I hate switching between echoing Javascript while writing PHP so I wrote one in PHP.


Copy this code and paste it in your HTML
  1. function alertJavascript($message){
  2. echo " <script type=\"text/javascript\">alert(\"$message\");</script> " ;
  3. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.