我寫調用一個遠程服務器上發現了一個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文件 –