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 trialvamosrope14
14,932 PointsCan someone please explain the difference between these two examples that Dave mentioned?
.
4 Answers
Steven Parker
231,269 PointsThe difference is where the request comes from. When you perform AJAX, the code is running in the browser. The same-origin policy applies to requests coming from a browser.
But if a server sends a request to another server, that restriction does not apply. That's what the video talks about.
vamosrope14
14,932 Points.
Steven Parker
231,269 PointsAlmost. The JS code is stored on the server. Otherwise, you've got it.
vamosrope14
14,932 Points.
vamosrope14
14,932 Points.
Steven Parker
231,269 PointsThe JS code is only stored on the server, it doesn't run there.
It gets downloaded by the browser and then the browser runs it.