Home » Microsoft » 70-480 v.2 » How should you complete the relevant code?
HOTSPOT
You implement a callback function by using JavaScript.
You need to process the returned XML data.
How should you complete the relevant code? (To answer, select the appropriate option from each drop-down list in the answer area.)
Hot Area:
Correct Answer:
Explanation/Reference:
* Example:
httpRequest.onreadystatechange = function() {
// inline function to check the status
// of our request
// this is called on every state change if (httpRequest.readyState === 4 && httpRequest.status === 200) { callback.call
(httpRequest.responseXML);
// call the callback function
}
};
// call the function
some_function2("text.xml", function() { console.log(this);
});
Reference: understand callback functions in Javascript