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! Debug JavaScript in the Console

my code on the first one is not working - alert("Hey,you're back for more?"); whats wrong with it?

my code on the first one is not working - alert("Hey,you're back for more?");

what's wrong with it?

1 Answer

Cameron Childres
Cameron Childres
11,820 Points

Hi Karl,

Your code is valid and works fine for me. Are you running this code in the console or through the workspace? If you're using workspaces, be sure to verify that you save the javascript file before reloading the page. Additionally, ensure that the file that you're adding the code to is linked correctly in the HTML document. For instance, if I'm working in the file js/preview.js I'll check for this line in my HTML before the closing body tag:

<script src="js/preview.js"></script>

If you're still having issues let me know so we can figure out what's going on. It can help to post a workspace snapshot so I can see exactly what's going on in your workspace.