You create an ASP.NET page.
The page uses the jQuery $.ajax function to make calls back to the server in several places.
You add the following div element to the page.
<div id=”errorInfo”>
</div>
You need to implement a single error handler that will add error information from all page $.ajax calls to the div named errorInfo.
What should you do?
A.
Add the following options to each $.ajax function call:
global: true,
error: function (XMLHttpRequest, textStatus, errorThrown){ $(“#errorInfo”).text(“<li>Error information is: ” + textStatus + “</li>”);
B.
Add the following code to the $(document).ready function on the page:
$(“#errorInfo”).ajaxError(function(event, request, settings){ $(this).append(“<li>Error requesting page ” + settings.url + “</li>”); });
C.
Add the following option to each $.ajax function call:
error: function (XMLHttpRequest, textStatus, errorThrown){ $(“#errorInfo”).text(“<li>Error information is: ” + textStatus + “</li>”);
}
D.
Add the following code to the $(document).ready function on the page:
$.ajaxError(function(event, request, settings){
$(this).append(“<li>Error requesting page ” + settings.url + “</li>”);});
Add the following option to each $.ajax function call:
global: true