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 AJAX Basics (retiring) AJAX Concepts AJAX Security Limitations

The AJAX works without a Server !!

So I was taking this course again as a refresher and I noticed something interesting, the AJAX works without the server. Maybe the behaviors of the browsers have changed? I need a better explanation. Thank you...

N.B: An npm HTTP-server was serving another folder though, is that the culprit? I think no, cuz it was in another directory. And I downloaded the project files and opened them as any other index.html file. nothing fancy.

It works with Liver Server plugin in VS code editor too.

3 Answers

Steven Parker
Steven Parker
231,007 Points

Any running server could be contacted by any client, no matter what file folder it was started from. Perhaps you can enable logging on the server to see the requests being handled.

I see... Thank you.

You're right, I tested it just now, after closing the server. Doesn't work.

Thank you Ikuyasu Usui, for sharing that !!! :clap: :smile: :sparkles:

I'll give that a try.