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 trialElizabeth Marrow
8,855 PointsThe page already has BOMB on it when I click preview and I can't figure out it out.
I am using chrome. When I start the new workspace, and click preview as instructed. The page already has BOOM on it and the first window that says ""Warning! This message will self-destruct in", does not pop up and the BOOM is already displayed. Thanks for your help!
8 Answers
Mark Sebeck
Treehouse Moderator 37,799 PointsIt should. The only thing that stops the page from displaying BOMB is the alert box that you will add. (because it waits for you to click on it before executing the rest of the javascript). Go ahead and work through the exercise and if you get stuck let me know or watch the next video. Guil walks you through the solution in the next video.
Elizabeth Marrow
8,855 PointsThank you!
Paige Demas
1,396 PointsMine did the same thing because I hadn't clicked save in the workspace editor
Neil Martin Orbase
4,137 PointsThanks for the tip, Paige! Forgot about good ole "Save" or "Command + S" before running the page with our code implemented.
Clint Oka
5,768 Pointsawww snap and I thought this was too easy lol. Yes I forgot to save too.
younes masaoudi
246 Pointsi fixed by <body onload="script();"> to prevent the script load before the body
younes masaoudi
246 Pointspr i put the script tag after body before end of html tag
ar14
16,986 PointsThat's expected. If you look inside of the index.html file you'll see that the <h1>
contains the string "Hello, JavaScript"
and the only line of code in the .js file before we edit it with our own is:
document.querySelector("h1").textContent = "🔥BOOM!🔥";
That line of JavaScript above tells your browser to change
Hello, JavaScript
to
🔥BOOM!🔥
Rachel Collins
1,632 PointsUPDATE: I got it... had it the whole time. =( I thought I had saved after reading the comments here but I surely hadn't. Thank you all for posting these suggestions!
i am having the same issue. i feel as though my script.js file is setup properly but the html is not. i can't figure it out.
Mark Sebeck
Treehouse Moderator 37,799 PointsGlad you were able to solve it Rachel. Great job, keep at it!! and forgetting to save happens often and is the cause of many frustrations.
Prescott Lawani
2,634 PointsYou need to put the alerts based on what you see in the comments ("//"). Boom, as he said, is already there but you need to put the code for the alerts first. Check the script.js file to see.
Ewan McDonnell
1,646 PointsShould I be running Treehouse within Chrome? I am using Opera and I can't get the workspace to work. It just displays the original content if I click preview. ...how do I get the workspace to run what i've done?
Ryan Carson
23,287 PointsYes, we'd recommend Chrome 👍🏻
Ainne Oum
3,221 PointsThe best is with Chrome!
lyubomyr kovbel
8,355 Pointslyubomyr kovbel
8,355 PointsIf anything you can comment out the pre typed text - save it and boom there will be no message on screen then before you run your code uncomment out the pre typed text and boom hehehhe you done it