You will find it:
- In your web browser (in pretty much every laptop, desktop and smartphone in the world, perhaps more than once)
- On your server - NodeJS provides a complete and powerful web server used by some of the biggest companies in the world, companies like Microsoft.
Create some HTML
First of all we'll need to make a web page for our script to live in. Create the following ultra simple html document and save it in a folder. Call it hello.html.
Write some Script
Hook them up
Now we need to link the two together. In the head of your html document add a script tag like so:
(Note that if you're an xhtml type of person, you should note that the script tag cannot be self closing. It will break in IE.)
What do you get?
Tip. To open the file in a web browser, you can double click it in your Explorer or finder window, or you can open Firefox and choose File -> open from the menu
Exercise - more alerts
Extend the code so it pops up two alerts.
So what did we do here?