var xmlHttp = createXMLHttpRequest(function(){});
executeXMLHttpRequest(xmlHttp,'',false);
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
if (xmlHttp.responseText.length >10){
//
}
}
}
}
xmlHttp.responseTex为空时,xmlHttp.responseText.length为6.不知道原因……
所有XMLHttpRequest.responseText == ""和XMLHttpRequest.responseText == null 一直无效
本文深入探讨了在使用XMLHttpRequest发送请求时,响应体为空时返回的length属性为何显示为6,而非通常预期的0或空字符串。通过详细分析,揭示了这一现象背后的原理,并提供了解释。
635

被折叠的 条评论
为什么被折叠?



