本文实例讲述了Ajax获取响应内容长度的方法。。具体如下:
var xhr = $.ajax({
type: "HEAD",
url: "path/to/file.ext",
success: function(msg){
alert(xhr.getResponseHeader('Content-Length') + ' bytes');
}
});
希望本文所述对大家的Ajax程序设计有所帮助。
本文实例讲述了Ajax获取响应内容长度的方法。。具体如下:
var xhr = $.ajax({
type: "HEAD",
url: "path/to/file.ext",
success: function(msg){
alert(xhr.getResponseHeader('Content-Length') + ' bytes');
}
});
希望本文所述对大家的Ajax程序设计有所帮助。

2023-03-03
0万阅读

2023-02-27
0万阅读

2023-02-09
7万阅读

2023-01-19
5万阅读

2023-01-14
5万阅读

2023-01-14
3万阅读

2023-01-14
5万阅读

2023-01-13
2万阅读

2023-01-13
3万阅读
2023-01-07
0万阅读

2023-03-03
0万阅读

2023-02-27
0万阅读

2023-02-09
7万阅读

2023-01-19
5万阅读

2023-01-14
5万阅读

2023-01-14
3万阅读

2023-01-14
5万阅读

2023-01-13
2万阅读

2023-01-13
3万阅读
2023-01-07
0万阅读