In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to edit AJAX". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to edit AJAX.
The specific analysis is as follows:
Although many JS frameworks now provide the method of calling AJAX, we can call it directly without even understanding its specific implementation principle, but I think it is difficult to do the best without understanding something at the most basic level.
Var XHR=null; if (window.XMLHttpRequest) {/ / non-IE kernel XHR= new XMLHttpRequest ();} else if (window.ActiveXObject) {/ / IE kernel. Here the earlier version of IE is written differently. For more information, you can query XHR= new ActiveXObject ("Microsoft.XMLHTTP");} else {XHR=null;} if (XHR) {XHR.open ("GET", "ajaxServer.action") XHR.onreadystatechange = function () {/ / readyState value description / 0, initialization, XHR object has been created, open / / 1 has not been executed, load, open method has been called, but request / / 2 has not been sent, loading is complete, request has been sent / / 3, interaction Can receive part of the data / / status value description / / successful / / 404: no file, query or URl / / 500: the server generated an internal error if (XHR.readyState = = 4 & & XHR.status = = 200) {/ / the returned content can be processed / / generally return JSON or XML data format console.log (XHR.responseText) / / release actively, JS itself will also recycle XHR = null;}}; XHR.send ();} at this point, I believe you have a better understanding of "how to edit AJAX", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.