Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,956 Points

please show us your code

4 Answers

Thomas Nilsen
Thomas Nilsen
14,956 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,956 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