Dev Corner

Software Developer’s Notepad

How to implement the simplest JavaScript code ? – the explorer to alert with “Hello JavaScript!”

For this purpose we use the function alert(), which opens up a box with a message. In our example it’s “Hello JavaScript!”, but it could be everything.

<script type="text/javascript">
	window.alert("Hello JavaScript!");
</script>

This function is very handy when there is a debugging process for a JavaScript. But be beware not to place it in a loop. Otherwise there would be a nasty alert for a lot of times, which could make you angry and you probably will have to press the “OK” button for a thousand times.