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 Your First JavaScript Program

Why is nothing being outputted even though I followed his steps exactly?

I followed the steps and copied exactly how the instructor did it, however, none of the commands worked in my workspace. After I saved and hit preview, neither alert nor document.write produced any results.

Thomas Nilsen
Thomas Nilsen
14,957 Points

please show us your code

4 Answers

Thomas Nilsen
Thomas Nilsen
14,957 Points

Have you included the script in your html file?

im not sure what you mean by that, all I did was follow the steps he outlined in the video aka just wrote the alert command into the workspace

Thomas Nilsen
Thomas Nilsen
14,957 Points

In your html-file. do you see something like this somewhere?

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

yes, https://gyazo.com/a62ce8c36a17818d5933dc6268bc36bb

my code is like this however the alert command is still showing nothing

I am having the same issue. I think it is a bug...

I just started with JS today, so I may be totally off on this.

There is an alert cmd written in a script tag in the HTML file:

<script>
alert("Hey youre back for more?");
</script>

Further down in the HTML file, there is another script tag linking scripts.js (wherein you have the same alert cmd) to the webpage:

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

Is it possible these are conflicting?

No, each script tag is self contained. They would not interfere with each other. If the alert method and the JavaScript page link were in the same script tag that would cause an issue. Great question though