Accessing local file with Ajax on Windows phone 8

╄→гoц情女王★ 提交于 2019-12-25 03:49:21

问题


I have a page Index.html which call a javascript, that make a ajax request looking for a local .html file This file is imported in my C# project as content and the javascript fire inside a WP8 webbrowser control.

The problem is that the ajax function return an access denied error. What can i do?

sorry for my broken english

Resolved by adding isLocal:true in the ajax request

$.ajax({
    url: "page.html",
    dataType: "html",
    async: false, // Otherwise Android 2.2 doesn't show menu
    isLocal: true, // Or Windows Phone will say "Access is denied" to ajax request
    success: function(html) {
       //success code!
    }
});

来源:https://stackoverflow.com/questions/15679045/accessing-local-file-with-ajax-on-windows-phone-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!