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 trialBharath Govindarajan
659 PointsAlert does not generate dialog box only a blank screen on chrome.
In scripts.js in the workspace when I type alert("Hello from Treehouse");
and hit preview I just get a blank screen in chrome.
7 Answers
Martijn Brackman
Full Stack JavaScript Techdegree Student 3,721 PointsChoose "file > save" when in "scripts.js" and then preview and reload the page again. It will work now.
Thomas Workman
7,173 PointsHmm...should work. Maybe post your code just in case something is missing. Might try refreshing Chrome and trying the preview again. You can also test the same thing by opening the browser inspector in Chrome and entering alert("what ever string you want here"); in the console.
Also, jsfiddle.net is useful for doing some JS testing. Hope that helps.
Bharath Govindarajan
659 PointsThe code is just
alert("Hello from TreeHouse");
I used jsfiddle.net and it seems to be working for now. Thanks.
Martijn Brackman
Full Stack JavaScript Techdegree Student 3,721 PointsSame issue here ... Typing it the console works tho.
Thomas Oakes
Courses Plus Student 220 PointsSame issue, I have tried the above to no avail.
Mark Ellis
Courses Plus Student 2,853 PointsSame issue for me here on google Chrome. It showed the alert the very first time I typed
alert("Hello from Treehouse!");
and then saved,
but once I added the following code,
document.write(<h1>Welcome to JavaScript Basics</h1>);
alert("Thanks for visiting!");
it's not worked since, even when I commented out the last two lines like this.
alert("Hello from Treehouse!");
//document.write(<h1>Welcome to JavaScript Basics</h1>);
//
//alert("Thanks for visiting!");
I've searched Google for answers and have tried the following solutions as well,
- Close offending tab and re-open
- Close and Restart browser
- Close browser and restart computer
Anyone had any luck solving this? Regards,
Mark
Keith Davis
54 PointsSame with Safari, I have tried using script.js and html file both the same, just the grey bar and nothing else when trying to view.
Nelly Nelly
7,134 PointsSame issue here, My solution was to work in my text editor rather than the workspace and launch index.html in the browser :) It works like a charm. make sure to create the index.html, scripts.js and the folder with main.css :)
Kevin Perez
Courses Plus Student 8,180 PointsKevin Perez
Courses Plus Student 8,180 Pointsworks!