I have never noticed this before. I have read kuibono's ArticleThe following is the manual collection of the XMLHTTPRequest object provided by kuibono. CodeParts:
Each jquery Ajax request creates an XMLHTTPRequest object. Theoretically, a persistent connection request is an infinite recursion and the number of requests is very large. However, each request creates a new XMLHttpRequest, in addition, jquery does not automatically Recycle resources, resulting in memory overflow.
By viewing the jquery API, it is found that jquery also has a complete object, which is a callback function after the request is complete (called after the request is successful or fails ). There are also two parameters: XMLHttpRequest and textstatus. Therefore, you only need to manually recycle the returned XMLHTTPRequest object after the request is complete. The Code is as follows:Copy codeThe Code is as follows: $. Ajax ({
URL: "http://www.jb51.net ",
Data: {name: "XXXX "},
Datatype: "XML ",
Success: function (data, textstatus ){
// Do something...
},
Complete: function (xhr, TS) {xhr = NULL}
});