我試圖用JQuery .get
和XmlHttpRequest
得到數據,但看起來他們都失敗了。Google是否不接受Spreadsheets中的ajax?
我正在試圖在電子表格中創建的模式對話框中執行此操作。
有沒有什麼不對,或者我在嘗試之前必須做的任何程序?
詳情:
1 - 模式對話框的工作(我的Ajax代碼之前把消息顯示精細,.get
後的消息也是精細
2 - 我知道谷歌英寸在服務器端,但我感興趣的只是現在的客戶端
代碼:
1 - jQuery的獲得:
alert("test");
$.get("http://www.w3schools.com/jquery/demo_test.asp", function(data,status){
alert(status + " /// " + data); //never shown
});
alert("after get"); //shown
2 - 的HttpRequest:
var Req = new XMLHttpRequest();
var URL2 = "http://www.w3schools.com/ajax/ajax_info.txt";
Req.open('GET', URL2, false);
alert("Got2");
Req.send();
alert("sent2"); //never shown
alert(Req.responseText); //never shown