0
我想離線運行一個簡單的網頁。這意味着我直接從桌面啓動html頁面而無需服務器。火狐& Safari不給我任何麻煩,但IE是當然。 IE版本9+jquery ajax文件:/ /不在IE中工作
我正在使用Jquery對本地json文件進行Ajax調用,該死的ajax調用只是沒有完成。我試過$ .get,$ .post,$ .ajax,$ .getJSON,$(「body」).load(),但都沒有工作。
我也嘗試過不同的URL 文件:/// C:/Users/user/Desktop/file.json C:/Users/user/Desktop/file.json C:\用戶\用戶\桌面\ file.json
我嘗試了不同的jQuery的版本太多1.8.3,1.11.3,2.1.3
我已經簡化它袒露被阻止出於安全原因的骨頭
$(document).ready(function() {
$.get("file:///C:/Users/user/Desktop/file.json", function(data){
console.log(data);
}).done(function(){
alert("done");
}).fail(function(){
alert("fail");
});
});
Ajax到文件協議不適用於任何瀏覽器? – adeneo