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.
How come I am not able to make this code work with sublime?
It's not responsive in chrome.
adam åslundCourses Plus Student 12,184 Points
The reason why it doesn't work is because AJAX only works on a webserver. This is a picture that shows the differences between review the files and the files running on a localhost.
There is two easy ways to inspect the webapp you are making. When you use your favorite text editor.
You download the project and write the code locally. When you are ready to test it you just copy the new code in to work spaces here at treehouse. You only need to copy paste. Then preview.
Get a localhost running on your own computer. I do this whit live reload on the page. So each time I save a file, the browser reloads the page. Right now I'm running a simple LAMP stack on my Linux machine. MAMP on mac and WAMP on windows works as well. There's even courses on how to install it on your mac and windows machine here on treehouse.
I hope this helps even tho it's been 19days since you asked the question.
Anselmo FresquezCourses Plus Student 8,086 Points
You would need to be running a local web server. Xampp or Mamp are easy to setup.
For a quick fix on a local host, you can use CDN instead of downloading Angular and JQuery into your project.
jason chan31,008 Points
you have to run a server to make it work. For example run on apache.
Install python 3.0
Navigate to folder of script with commandline using cd. I hope that helps. command python -m http.server in terminal this is pc. python -m SimpleHTTPServer for mac