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 trialGeorge Akinian
17,615 PointsHow come I am not able to make this code work with sublime?
It's not responsive in chrome.
5 Answers
adam åslund
Courses Plus Student 12,184 PointsHi Paul!
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.
dd710
24,896 PointsWhat issue are you having ? And are you trying to run your JavaScript code in Sublime?
Anselmo Fresquez
Courses Plus Student 8,086 PointsYou would need to be running a local web server. Xampp or Mamp are easy to setup.
George Akinian
17,615 PointsFor a quick fix on a local host, you can use CDN instead of downloading Angular and JQuery into your project.
replace:
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>
with:
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.
Cheers!
jason chan
31,009 Pointsyou 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