What is url in Post Data with the JavaScript XMLHttpRequest Method

What is url in Post Data with the JavaScript XMLHttpRequest Method
0

#1

JSON APIs and Ajax: Post Data with the JavaScript XMLHttpRequest Method

In the previous examples, you received data from an external resource. You can also send data to an external resource, as long as that resource supports AJAX requests and you know the URL.

JavaScript’s XMLHttpRequest method is also used to post data to a server. Here’s an example:

req=new XMLHttpRequest();
req.open(“POST”,url,true);
req.setRequestHeader(‘Content-Type’,‘text/plain’);
req.onreadystatechange=function(){
if(req.readyState==4 && req.status==200){
document.getElementsByClassName(‘message’)[0].innerHTML=req.responseText;
}
};
req.send(userName);


#2

It would be the actual URL to post the data to, but in the challenge it is undefined in the example. Maybe provided by the backend if you copy the code over, however that doesn’t work. Sounds ripe for a bug report, if there isn’t one about it already.