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 JavaScript Basics Hello, JavaScript! JavaScript Challenge Solution

why when I refresh the page the code is not running?

I typed everything out just like the example and saved it. When i refresh the page it does not do anything.. originally I tried creating a new file .js and pointing to the code with script but that did not work so I just copied the example, what am I doing wrong and how would I use the script command to point to the new file to run? I know we basically just learned this but I'm having difficulties.

UPDATE: Sorry guys was not clicking the preview button, thought refreshing the page was supposed to run the code, rookie mistake.

2 Answers

Steven Parker
Steven Parker
231,268 Points

This looks OK, but it only works with matching HTML code. The HTML part is shown in the JavaScript Practice Challenge video around 2:15.

Note that the code on line 12 is what loads in and runs the "script.js" file.


UPDATE: looks like you resolved your own issue! :+1:

Yes, thank you btw for the extra info. I didn't realize that..