This article mainly introduces the method of Ajax to obtain the response content length, and involves the use skills of the return method after the Ajax call is successful. It has certain reference value. Friends in need can refer to it.
The examples of this article are described Ajax method to get response content length. Share it with everyone for your reference. The details are as follows:
var xhr = $.ajax({ type: "HEAD", url: "path/to/file.ext", success: function(msg){ alert(xhr.getResponseHeader('Content-Length') + ' bytes'); } });
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Detailed explanation of ajax jtemplate to implement dynamic paging
A simple implementation of Ajax showing progress during the request process
JQuery Ajax dynamically generates Table
The above is the detailed content of Ajax method to get response content length. For more information, please follow other related articles on the PHP Chinese website!