In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is the use of ajaxError ()". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "what is the role of ajaxError ()?"
No matter which Ajax request is completed, all ajaxError processors will be executed. If we have to distinguish between different requests, we can pass the parameters to this processor. It passes the event object, the jqXHR object (before jQuery 1.5 is the XHR object), and the setting (settings) object used to create the request each time the ajaxError handler executes the request through the request used in the event object, the XMLHttpRequest object, and the setting object. If the request fails, because JavaScript throws an exception and the exception object as the fourth parameter is passed to the handler. For example, we can limit our callback to only handle events and handle a particular URL:
$(document) .ajaxError (function (event, jqxhr, settings, exception) {
If (settings.url = = "ajax/missing.html") {
("div.log") .text ("Triggered ajaxError handler.")
}
})
Other considerations:
If the global option is set to false, calling the $.ajax () or $.ajaxError () method will not be triggered.
Example:
Displays a message when the Ajax request fails.
$(document) .ajaxError (function (event, request, settings) {
$("# msg") .append ("Error requesting page" + settings.url + "")
})
The above is all the content of the article "what is the purpose of ajaxError ()". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.