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 Foundations Numbers Operators

localhost

how to get the localhost running so I can test my javascript?

3 Answers

J Scott Erickson
J Scott Erickson
11,883 Points

The easiest way to run code for testing would be to include your .js file into a .html file and open the page in a browser. then right click and select 'inspect element' then you can use the console in the popup to write, test, and debug code. (These instructions work for Google Chrome, been a while since I used Firefox and even longer since I used IE but I assume this is a similar process to at least Firefox).

Javascript runs in browser, you don't need a server environment to work with it.

For plain classic Javascript, you don't need to setup a localhost or have any server. All you need to start coding in JS is a browser and a text editor.

However, if you still think that what you're doing requires a localhost (perhaps you forgot to mention it) then I would suggest using a cool software called WAMP to setup a local server. It's pretty easy too!