问题
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