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
MOD
Cameron Childres
Treehouse Moderator 11,695 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.