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

Chris Martinet
Chris Martinet
3,705 Points

How do i setup local host to practice my Javascript?

I'm trying to follow along with Jim Hoskins in the beginning JS foundations course.... But i can't find a lesson detailing how to setup 'localhost.' I've tried a few things online with no success and am dead in the water. Any and all advice is appreciated.

4 Answers

All you need to practice javascript is a web browser and a text-editor.

There is software that turns your desktop computer into a web server (see xampp it's usually used for developing dynamic websites on your computer. You access the server by typing 'localhost' into your address bar. If you are just doing javascript, it's not necessary.

You could make a html file on your desktop and either link to an external .js file or add a script tag to the bottom of your html file and add any javascript in there. Alternatively, use the workspaces feature on treehouse.

Hope this helps!

Chris Shaw
Chris Shaw
26,676 Points

Hi Chris,

If you're running OS X Apache is built in already but it's very out of date so I would recommend [http://www.mamp.info](MAMP) however if you're on Windows [https://www.apachefriends.org/index.html](XAMPP) is a pretty good choice however [http://www.wampserver.com/en/](WAMP) is slightly more user friendly.

Kevin Korte
Kevin Korte
28,148 Points

Since javascript is client side you do not need a localhost server to practice javascript. If you just open your HTML file in your browser, the javascript will run.

To run server side stuff like PHP you'll need a local server. I use XAMPP on windows and Mamp on Mac personally.

Chris Martinet
Chris Martinet
3,705 Points

Hey guys, thanks for all your help. Got what i needed and then some. TY again, much happiness from the internet today :)