<分区>
我想使用 jquery 获取某个 ajax 请求的持续时间。例如我正在使用这个脚本:
$.ajax({
type: "GET",
url: "http://localhost/thescript.php",
success: function(data){
$("#container").html(data);
},
complete: function(jqXHR, textStatus){
alert("http://localhost/thescript.php took 'n' seconds to load");
}
});
我想知道这个 ajax 脚本加载 url“http://localhost/thescript.php”的时间有多长。例如警报:“http://localhost/thescript.php 加载时间为‘n’秒”。