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 (Retired) Introducing JavaScript Link to an External Script

Lizzie Landers
Lizzie Landers
615 Points

Alerts and script file data not appearing on my workspace

Here's my code; it doesn't work I'm getting no alert boxes popping up and I've saved the files a few times. Do I need to refresh browser before previewing?

<title> Javascript Basics</title>
<script src="scripts.js"></script>
<script>
alert("Hello from Treehouse again.");</script>

Edited: The code I input is not showing up. It shows here in my edit box but the syntax is completely removed once I post. What do I need to remove or change on my end. Sorry for the NOOB question. !

Michael Hulet
Michael Hulet
47,913 Points

As for the syntax disappearing, it's because it was HTML, which Treehouse automatically renders into your question, instead of showing the code. I fixed it for you, and if you want to see how I did so, you can try editing your question. As for what's going on, I'll put that in an actual answer

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

If you're doing this in a workspace, you should definitely refresh your preview window before looking at it. Otherwise, your syntax looks good to me. Maybe make sure your browser lets Treehouse show alerts?

Lizzie Landers
Lizzie Landers
615 Points

Thanks for the help! Noted for future.