Which line of code should you use?

You are developing a web page that consumes a Windows Communication Foundation (WCF) service. The page includes the following code segment.
var xhr = new XMLHttpRequest() ;
The page uses the xhrHandler() method to listen forchanges to the request status of the WCF service calls. It uses the xmlToJavaScript() method to convert the response from the WCF service to a JavaScript object. The xhrHandlerQ method must be called automatically each time the request status changes.
You need to add the event handler to the request object.
Which line of code should you use?

You are developing a web page that consumes a Windows Communication Foundation (WCF) service. The page includes the following code segment.
var xhr = new XMLHttpRequest() ;
The page uses the xhrHandler() method to listen forchanges to the request status of the WCF service calls. It uses the xmlToJavaScript() method to convert the response from the WCF service to a JavaScript object. The xhrHandlerQ method must be called automatically each time the request status changes.
You need to add the event handler to the request object.
Which line of code should you use?

A.
xhr.onCallback = xhrHandler;

B.
xhr.onreadystatechange = xhrHandler;

C.
xhr.readyState = xhrHandler;

D.
xhr.status = xhrHandler;



Leave a Reply 1

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