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 Introducing JavaScript Finishing the Game Adding New Graphics

I can't run the game on my PC!

I downloaded the files on my PC but the game doesn't work. When I open the index.html on the browser, I got green background only.

Could you please help me fix this?

4 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I'm going to make an educated guess here. I believe you are trying to run this from files you downloaded to your local system instead of from workspaces. I also believe you might be using the Chrome browser. If this is the case, there are certain properties of this particular browser that will prevent you from running this without disabling some security properties in the browser itself. These are advanced topics that you will deal with later, but in the meantime I highly suggest you either run the code from the workspaces or you try another browser such as Firefox.

To be clear, the files you make on workspaces when doing this course will still be run on your computer and in your browser, but there's a "cross-origin" policy in place by default which is preventing it from running as intended. Again, this is an advanced concept you'll likely cover later.

Let me know how it goes! :sparkles:

I have figured it out. The teacher left notes about how to fix this through the last video. He left a link for chrome extension that works as a web server to be able to run the script on the browser. I am just starting out with JAVASCRIPT, so I am not sure why we use server to run the script.

Thank you for your interest.

hi fathia, Could you please show me which teacher's note about how to fix the issue that you have mentioned above? Thanks

Hi Ann, Please check the teachers's note under
"Finishing the Game" section >> "Wrapping It Up" video here's the link: https://teamtreehouse.com/library/wrapping-it-up

I have no problem with running the Javascript using Windows 10 and Firefox browser(version 62 64bit).