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 The JavaScript Console

Why is my alert box only appearing the first time I open the workspace?

When I open workspace and preview my javascript code, it works and the alert box appears. When I go back and edit the code, save and preview, the alert box does not appear. Why is that?

Can you post the code? Are you doing a challenge or following along with a video?

I'm following the video. Here is the code:

alert("Hello, there!");
document.write("No, it works!");

I checked the console and it's still reading errors even if I saved it.

2 Answers

Try refreshing the page in the browser.

I've tried, but it didn't work :/

What is the error message that's coming up in the console? On the righthand side, does it say which file and line number the error is on?

Your code looks right, I think it's just a weird server problem or something. I would restart your computer and go for a walk :)

I already passed it and I'm not sure where it is. I know the code I did is right, but I'm not sure why the issue happened. I'll let you know if I run into it again.

Thanks for the help!