Testing out Javascript in the developer console or with JSFiddle is easy. However, when you want to create your own files and work from your favorite text editor things can get a bit trickier.
If you open an HTML file with a web browser from your computer, you’ll notice that the URL starts with “file://”. Every web page you go to has a URL that starts with “http://”. This indicates the protocol that your web browser is trying to open the file with. When the protocol is “file” sometimes Javascript won’t work properly. Luckily, on a Mac, it’s easy to get around this.