You can also add
In general, adding the reference to the script file before the closing
body tag is a good idea, since this allows your web page content to load first. However, if you have scripts that need to load first, you would insert the script reference much earlier, such as in your
- Everything is case sensitive. "Alert" is different from "alert".
- Semicolons end a statement.
- Spaces don't matter except inside quotations.
In general, add comments above the lines they refer to. You can also add comments to multiple lines using
*/ just like you do in CSS:
I'd Rather Be Writing Newsletter
Get new posts delivered straight to your inbox.