你好,我想知道XMLHttpRequest.response和XMLHttpRequest.responseText有那些区别,分别用在哪些场合,谢谢。比如下面的场合:params = "response" in XMLHttpRequset ? XMLHttpRequset.response : XMLHttpRequset.responseText;
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties
Returns an ArrayBuffer, Blob, Document, JavaScript object, or a DOMString, depending of the value of XMLHttpRequest.responseType. that contains the response entity body. This is null if the request is not complete or was not successful.
Returns a DOMString that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
请求返回的内容格式不一样吧,responseText 以文本的格式序列化返回的内容。