简体   繁体   English

如何使用 JavaScript 获得带有字符串的 http 网站的响应?

[英]How to get the response of an http website withing a string using JavaScript?

How to get the response of an http website within a string?如何在字符串中获取 http 网站的响应? Whatever it was an xml, JSON, html...?不管它是 xml、JSON、html...?

see this http://ajaxpatterns.org/XMLHttpRequest_Call .看到这个http://ajaxpatterns.org/XMLHttpRequest_Call

you can get the http status code with the status property on the xhr.您可以通过 xhr 上的status属性获取 http 状态代码。 You can get the actual response text in the responseText property.您可以在responseText属性中获取实际的响应文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM