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.
Alert 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.
Choose "file > save" when in "scripts.js" and then preview and reload the page again. It will work now.
Thomas Workman7,173 Points
Hmm...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.
The code is just
alert("Hello from TreeHouse");
I used jsfiddle.net and it seems to be working for now. Thanks.
Same issue here ... Typing it the console works tho.
Same issue, I have tried the above to no avail.
Same 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,
it's not worked since, even when I commented out the last two lines like this.
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,
Nelly Nelly7,134 Points
Same 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 :)