【发布时间】:2017-06-14 05:29:19
【问题描述】:
我有下一个代码:
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "http://www.youtube.com");
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('master').innerHTML = xhttp.responseText;
}
};
xhttp.send();
我在 google 和 Facebook 上尝试了同样的方法,它在浏览器和手机中运行良好,但 youtube 仅在浏览器中运行 ¿ 发生了什么?
pd: browser = 桌面浏览器
pd: pd: 它进入 if 并执行 innerHTML 但在手机中 responseText 不返回任何内容
【问题讨论】:
标签: cordova http ionic-framework get phonegap