gpt4 book ai didi

javascript - XMLHttpRequest 的 readystate 属性是否可编辑?

转载 作者:行者123 更新时间:2023-11-30 17:25:35 28 4
gpt4 key购买 nike

XMLHttpRequest 的 readyState 属性是否可编辑?

function myFunction() { 
loadXMLDoc("ajax_info.txt", function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
});
}

我可以在这里自定义status==200readyState==4 的值吗?

最佳答案

如 XMLHttpRequest spec 中所述,这些属性是只读的:

readonly attribute unsigned short readyState;
readonly attribute unsigned short status;

您不能修改它们。

关于javascript - XMLHttpRequest 的 readystate 属性是否可编辑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24368051/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com