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 Foundations Variables Basics

Task 1 of the JS Basics course is broken.

The very first assignment is to move to script tag so it loads after the page has loaded. When you do this you get an error since their is already some JavaScript in the myscript.js file. Completely removing this code makes the task complete but it's not the way it should be.

Especially since there is way more code in there then is needed to complete the entire task.

<a href="http://imgur.com/Lye3peH"><img src="http://i.imgur.com/Lye3peH.png?1" title="source: imgur.com" /></a>

3 Answers

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

Just to be clear - you did try moving the script so that it's the last thing within the body tag?

Lin Lu
Lin Lu
29,171 Points

Move the JavaScript tag to right before the body closing tag, it worked for me.

Thanks. I thought i did but clearly i didn't. :P

I just retyped it so it was in there twice. Noticed it just after i uploaded the pic.

Hi Ethan,

Yes. I did. The system included the code of the challenge automatically.

I'll add a pic to the OP to explain show what was giong on.

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

Cool. Please remember to leave comments, not answers, also.

Will do. Haven't posted much on these forums yet. Pic included as comment to OP.

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

Strange error you posted admittedly, however it looks like you have only copied the script tag to the bottom and not gotten rid of the original, so I imagine that's the problem.

Yeah, i saw it, right after i posted the pic. My bad. Guess i could use another coffee.

Sorry for wasting your time. :P

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

No worries...99% of 'bugs' you make in programming will be things you can catch by carefully looking over what you've done, so it's a good lesson to learn early. Good luck and remember to pick a best answer etc. when you're done.

Yeah, i noticed. Sometimes you can stare blind at your code and not notice the really simple error you make. Fortunately the community here is very helpfull. Thanks again to both of you. Marked you both down as "best answer" if it's possible to give more than one.