FAQ: Requests I - XHR POST Requests II

This community-built FAQ covers the “XHR POST Requests II” exercise from the lesson “Requests I”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction To JavaScript

FAQs on the exercise XHR POST Requests II

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Why did we return the response in the if block of the onreadystatechange anonymous function? Where will this return go, since we aren’t calling the function directly?


Why can’t we use the bracket notation as the property accessor to XHR?
Everywhere we are requested to use dot notation although in previous lessons about object we were told these are the exchangeable

I don’t understand what this line of code is for. Why are we putting ID and the number 200? This is the second time I’ve done this section of the course and have watched various other videos outside of codecademy so I’m reaching out in the hope someone can help!

const data = JSON.stringify({id: '200'})