Send() function question


hello there,

I'm a bit confused, I just went over the hole course again and didn't understand the usability of the send() function.
we already sent the request with the ""GET", "URL", false);" function, haven't we?

Oh and somthing more.. where can I find a detailed explanation about all the functions and arguments ajax using?

moshe. :slightly_smiling:


Hi Moshe!

I assume you're referring to the XMLHttpRequest methods open() and send(), which in this case are represented by and xhr.send().

It's quite normal in programming languages to separate the functions which prepare ( and send (xhr.send()) HTTP requests. There may be instances where you want to prepare a request but not necessarily send it yet.

The XMLHttpRequest object is the keystone of ajax programming, so if you want to know more about that object's methods and properties you could start by looking at W3Schools or the Mozilla Development Network.


Hi flaky6,

I was also confused when I encountered the "NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load '' ". The mistake is in the Open() function "URL" argument which should be "". I was using and I kept getting error, until i carefully checked the earlier example.

The instruction on codecademy says use "" as the URL instead of this "". So Codecademy need to correct that.