Getting Started

You can start by learning how to write HTML code and maybe CSS and then come back here to learn about JavaScript. In your test-page add script tag and point to where that file is located.

<script src="myfile.js"></script>

To test if you are pointing to right file, you can write this to myfile.js.

alert('Hello world')

If you see an alert when you refresh, then you are doing it right.

In this book we are following the best practices and standards. You might see some other way of doing things in other books or elsewhere on the internet. I’m trying to avoid bad parts and awful practices.

In this book we are focusing on new browsers and not coding for old browsers. It helps if you use and know how to use the Google Chrome JavaScript Console.

On Mac with Chrome you can press option + command + j.

This is where all the errors and logs is going to show up.

Just to test if you have managed to open up the JavaScript Console, write this to myfile.js and see if you can see the log in console.

console.log('hello console')

Nice! Now we can go on and do some real learning.