Because of Adobe ended their development on flash, game developer now focusing on html5 base game. What is HTML5? HTML5 is a language to present the web content, and that including web application. The best part of it, HTML5 is free, everyone can use it, unlike adobe flash, developer need a big cash to buy flash software. The bad part of HTML5 is not every browser can support it yet. Modern browser like Chrome, Opera and Firefox are suggested.
Using javascript, we can display a message box or pop up in a new window, there is three type of pop up, alert, confirm, and prompt. example:
The Alert Box Code
<script type="text/javascript"> { alert("I am an alert box!"); } </script>
The Confirm Box Code
<script type="text/javascript"> { confirm("Press a button!"); } </script>
The Prompt Box Code
<script type="text/javascript"> { prompt("Please enter your name","John Doe"); } </script> putting this code will alert visitor every time the page is load. We should add function, function is like giving a name to your code. example: function function_name(variable)
<script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } </script>
To call up function we can use input, button or anchor tag. Input tag with button type example:
This is example how to use multiple pop up box in a single script The code: <script type="text/javascript"> function combine() { var name=prompt("Please enter your name","John Doe"); if (name!=null && name!="") { confirm("Hello " + name + "! How are you today?"); } alert("thanks for your visit") } </script>
Combining so many box will make never-ending pop up, that's a bad practise for website.
Pop up box are less popular now because of overuse in the past, internet browser offer pop up blocker to prevent dialog box, but there is many javascript framework can make pop up box with browser friendly and offer beautiful user interface.