FAQ: Requests I - Review Requests I

This community-built FAQ covers the “Review Requests I” 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 Review Requests I

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!

Within the context of this exercise, in the section where you read: “If you want to challenge yourself:”, you are encouraged to use a different API to make a GET or POST request. What other API’s are there and what are they? I’m not very clear on this.

I looked at the specs at AJAX - The XMLHttpRequest Object

I saw no mention of .response as used in line 23 of exercise 10 of the lesson on Requests II of intro to Learn JavaScript..

And when I played around a bit and tried to use the property responseText just before it, e.g. alert('Response text = ', xhr.responseText), all I got was “Response text =”.

The exercise uses something I don’t see in the specs and when I use something from the specs, I don’t get my expected result. I must be misunderstanding something. Any suggestions on what I’m missing?


You may have figured this out already, but w3schools.com is not an authoritative source and may have incomplete information or even be wrong. In the case of XMLHttpRequest, the documentation is at developer.mozilla.org

does anyone know of someplace else that has a better tutorial on the topic of this whole module? I just got done with this module and feel like i understand anything

Literally the worst lesson on this site. No explanation, no depth, no application, just copy and paste this code here with a congrats!! you did it after

1 Like

why the above code line is used in index.html?

I am trying to replicate the wordsmith project, and learning about each block of code and how it relates to the AJAX request.

in the main.js file, I can’t understand why we need this function:


I understand the code below:

while(responseField.firstChild) // while we there is a child HTML element in the response field
responseField.removeChild(ResponseField.firstChild); //remove the  element to refresh

However, I have no idea why we need ‘preventDefault’ for it to work. I can’t get it to load the response to the div on my own without that key piece of code.

Is there some default button action with the event listener that we have to clear out? I though the whole point is we assign the function to the event listener.

For example, the built in behavior of Submit in a form element is to build an array of name/value pairs and send to the server address in the action attribute. Our script cannot run if this default behavior is not disabled.

1 Like