我在 JQuery 论坛中讨论了我的问题并得到了有用的答案 :
event is an ajaxError event object and doesn't contain any particularly useful information. xhr is the jQuery wrapper around the XMLHttpRequest object that made the request - useful attributes are status and statusText. options is the full set of options sent to the ajax request - useful attributes are url, isLocal, and type. exc is the exception thrown - useful attributes are filename and message, and possibly lineNumber and columnNumber.
$('#results').ajaxError(function(event, xhr, options, exc) {
$(this).text('Couldn\'t load ' + options.url + ' because (' +
xhr.status + ' - ' + xhr.statusText + ') ' + exc.message);
});
并且另外研究The Event Object (page 173)
了JavaScript & jQuery: The Missing Manual, 2nd Edition
书的部分。部分金额为:
事件对象
Whenever a web browser fires an event, it records information about the event and
stores it in an event object. The event object contains information that was collected
when the event occurred, like the vertical and horizontal coordinates of the mouse,
the element on which the event occurred, or whether the Shift key was pressed when
the event was triggered.
现在知道什么是不明白的。就一件事:
谁能明确地给我几个$.ajaxError event(parameter) attributes.
我进行调试的实例,Firebug
并查看event Object
并发现非常有用的信息,但我是新手,需要一些适合我的文章的功能$.ajaxError parameters.