我写调用一个远程服务器上发现了一个PHP文件中的以下GET请求, 代码如下:阿贾克斯“GET”请求错误NS_ERROR_FAILURE:失败
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://xxxxxxxxx/get_determined_prize.php", false);
xhr.send('');
console.log(xhr.responseText);
但在Firefox的安慰它显示NS_ERROR_FAILURE:失败
在服务器端的php文件只包含以下内容:
<?php
echo "5";
?>
是什么错我的代码?或者我错过了什么?
它在同一起源吗?也看看http://stackoverflow.com/questions/5686377/0x80004005-ns-error-failure-nsidomhtmlformelement-submit和http://stackoverflow.com/questions/11202153/ns-error-failure-on-javascript -post –
在远程服务器上找不到php文件 –