Question: Using the following code and AJAX call, how would you add functionality so user can enter course prefix and results will update? // ---------- AJAX
Using the following code and AJAX call, how would you add functionality so user can enter course prefix and results will update?
// ---------- AJAX CALL ----------
var req = new XMLHttpRequest(); // create an ajax request
var url = 'https://api.svsu.edu/courses;
var jsonObj;
req.onreadystatechange = function() {
var readyStateDone = 4;
var readyStatusSuccess = 200;
if (this.readyState == readyStateDone &&
this.status == readyStatusSuccess) {
jsonObj = JSON.parse(this.responseText);
}
};
| {{course.prefix}} | {{course.courseNumber}} |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
