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

APIs Write a Basic Fetch Request

Akili Foster
Akili Foster
68 Points

I am confused on how to use Fetch. What is the basic purpose of it?

I am confused on how to use Fetch. What is the basic purpose of it?

1 Answer

Steven Parker
Steven Parker
231,271 Points

Fetch allows you to request additional resources without reloading the page. It is an updated and simplified replacement for "XMLHttpRequest" which is part of the AJAX mechanism.

Steven Parker
Steven Parker
231,271 Points

As I said, it's intended as a replacement for XMLHttpRequest. It's similar to the jQuery methods, but it lacks some of the CORS (security) handling that jQuery does.