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:

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:

Answer:

Explanation:
* 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);
});
understand callback functions in Javascript



Leave a Reply 0

Your email address will not be published. Required fields are marked *