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 trial

JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

jefferson san pedro
seal-mask
.a{fill-rule:evenodd;}techdegree
jefferson san pedro
Python Web Development Techdegree Student 4,076 Points

cant see preview in browser

writing an alert on workspace and won't appear in browser to preview

Dave McFarland
Dave McFarland
Treehouse Teacher

Can you post your code here, so we can see it.

Also, have you checked the browser's JavaScript console for any errors? You can open the console with one of the keyboard shortcuts below:

Chrome Console Keyboard Shortcuts

  • Windows: Ctrl + Shift + J

  • Mac: Cmd + Option + J

Firefox Console Keyboard Shortcuts

  • Windows: Ctrl + Shift + K**

  • Mac: Cmd + Option + K

Internet Explorer Console Keyboard Shortcuts

  • F12 key

Safari Console Keyboard Shortcuts

  • Cmd + Option + C

6 Answers

You might want to check to see if pop-ups are being blocked. Are you using Adblock or Ghostery?

Eric Gu
Eric Gu
3,871 Points

Another option is to use cloud IDE. c9.io. It is awesome to see your work live!

gary franklin
gary franklin
12,309 Points

There may be something wrong with the treehouse workspace and Firefox, as I cannot see my commands from the workspace appear in Firefox...but if I use the Firefox developers console I can see them.

Dave McFarland
Dave McFarland
Treehouse Teacher

Do you mean in the "console" part of a workspace? If that's what you mean, the console that appears at the bottom of the workspace is not actually the same as the JavaScript console or developers console. It's more like a terminal in Mac or Linux or the command prompt in Windows. You use it with Sass, for example, to compile Sass to CSS.

Ahmed Abdelaal
Ahmed Abdelaal
6,328 Points

I had the same issue. Adding semicolons at the end of each statement fixed it for me. Keep in mind that you're not really required to do that in JS but you'll hear mixed opinions about including them or not. Just choose your convention and be consistent.

I cannot see the results of the preview tab either.

FYI: -Using Chrome browser on Mac OSX Yosemite.

I fixed this somehow by enclosing the alert("Hello World"); in a function call:

function myFunction() { alert("Hello World"); }

myFunction();

and it worked.

After I refactored the code to just the original alert("Hello World"); and saved it, it worked without the function call.

Weird ...