Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introduction to Programming Basics Writing Your Program

My javascript file will not load in Chrome - "Failed to load resource: net::ERR_FILE_NOT_FOUND"

I created a local, desktop folder called "web" and it includes both exercise files: index.html and myscript.js.

The index.html file renders fine in Chrome but the myscript.js file fails to load.

Also, I created the files on a Mac using TextEdit and I noticed their might be character issues using " " marks (UTF-8).

Thanks for your help.

Hugo Paz
Hugo Paz
15,622 Points

Hi Joseph,

Could you please post your html code here.

3 Answers

Great...I'll try that.

Thanks again for your help.


That did it!

Hi Hugo,

Here is my index.html code:

<!DOCTYPE html> <html lang=β€œen”> <head> <title>Introduction to Programming</title> <style> html { background: #FAFAFA; font-family: sans-serif; } </style> <script src=β€œmyscript.js”></script> </head> <body> <h1>Introduction to Programming</h1> <h2>with Javascript</h2> </body> </html>

Hugo Paz
Hugo Paz
15,622 Points

There is an issue with your quotes like you assumed. Its due to textedit being a rich text editor. Try following these steps if you want to keep using it.

I changed the settings in TextEditor, edited my files, re-saved them and I'm still having the same issue. Also, I re-saved them using TextWrangler and that didn't help, either.

Could you suggest another text editor for a Mac? Maybe, I can recreate the files in a new editor and see if that works.

Hugo Paz
Hugo Paz
15,622 Points

I use sublime 2, you can download it for free.