In the sample code provided in the lesson, the variable url is not defined. So, though copying and pasting the sample code passes the tests, the code does not work as intended.
The variable url should be defined and hold the path to the server.
To Reproduce
Copy and past the sample code from the lesson into the code window, below the comment // Add your code below this line.
Click on "Run the Tests".
Close the popup with the check mark.
Enter your name into the textbox on the right, and click Send Message.
Expected behavior
(From the lesson) Your AJAX function will replace "Reply from Server will be here." with the reply of the server. In this case, it is your name appended with " loves cats".
Actual Behavior
Instead, nothing happens. A quick trip to the console shows the reason. The variable url is not defined.
So, nothing is sent to the server.
Describe the bug
In the sample code provided in the lesson, the variable
url
is not defined. So, though copying and pasting the sample code passes the tests, the code does not work as intended.The variable
url
should be defined and hold the path to the server.To Reproduce
// Add your code below this line
.Expected behavior
(From the lesson) Your AJAX function will replace "Reply from Server will be here." with the reply of the server. In this case, it is your name appended with " loves cats".
Actual Behavior
Instead, nothing happens. A quick trip to the console shows the reason. The variable
url
is not defined.So, nothing is sent to the server.