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 trialZeyneb Majid
133 PointsWhy 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.
Zeyneb Majid
133 Pointshttps://gyazo.com/1a34af8b89c5dd1fc52c87f58300bc0b my code
https://gyazo.com/67e988b36a2ee03500bf0bd17d3e4d12 what shows up after i save and hit preview.
4 Answers
Thomas Nilsen
14,957 PointsHave you included the script in your html file?
Zeyneb Majid
133 Pointsim 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
14,957 PointsIn your html-file. do you see something like this somewhere?
<script src="scripts.js"></script>
Zeyneb Majid
133 Pointsyes, https://gyazo.com/a62ce8c36a17818d5933dc6268bc36bb
my code is like this however the alert command is still showing nothing
Jason Ladieu
10,635 PointsI am having the same issue. I think it is a bug...
Christopher Sea
3,726 PointsI 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?
Jason Ladieu
10,635 PointsNo, 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
Thomas Nilsen
14,957 PointsThomas Nilsen
14,957 Pointsplease show us your code