August 2017
Intermediate to advanced
214 pages
4h 31m
English
In the third chapter, we started work with Node.js, which was JavaScript that ran on the server side. Now, we're going to introduce client-side JavaScript, or JavaScript that runs on the browser.
To run JavaScript on the browser, you will need to add a script tag anywhere in the HTML document.
The standard script tag looks like this:
<script> console.log('Executing client side javascript ...') </script>
It is better, however, to put your JavaScript code in a separate file altogether, which is when you would use the alternate syntax:
<script src="script.js"></script>
Add this script tag as the last element inside <body>. Along with this, include a file called script.js in the public directory and populate ...
Read now
Unlock full access