Please reconsider local!!! file ajax issue in wp8

Bugs will be moved here once resolved.

Post » Thu Mar 06, 2014 7:53 pm

Ajax plugin (XMLHttpRequest) can't load local file, because XMLHttpRequest only works for retrieving network resources. i.e. You cannot use it to access content from your applications local storage, i.e. XAP or IsolatedStorage.
http://social.msdn.microsoft.com/Forums ... =wpdevelop

1.please reconsider local!!! file ajax issue in wp8

ajax-plugin-doesn-t-work-properly-on-windows-phone-8-simulat_t97280

2.helpful link for resolving this issue

XMLHttpRequest only works for retrieving network resources. i.e. You cannot use it to access content from your applications local storage, i.e. XAP or IsolatedStorage.
http://stackoverflow.com/questions/1980 ... -html5-app

Accessing local file with Ajax on Windows phone 8
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!
}
});
http://stackoverflow.com/questions/1567 ... ws-phone-8

I'm trying to load templates in WP8 PhoneGap app using jQuery.ajax with options isLocal=true and url="x-wmapp0:www/path/to/file.html". When I use jQuery 1.* all works fine. But using jQuery 2.* ajax returns an error "Error: Access is denied." It is because ajax in 1.* in IE works using window.ActiveXObject("Microsoft.XMLHTTP"). But in 2.* it is use XMLHttpRequest.
https://issues.apache.org/jira/browse/CB-5003

Add WP8 support for xhr requests to local files
https://github.com/enyojs/enyo/pull/234
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Fri Mar 07, 2014 5:37 pm

We don't use jQuery for AJAX, so that code snippet doesn't apply. I've tried a few workarounds including preprending x-wmapp0:/ or x-wmapp0://www/ (you can try these yourself by requesting a URL instead of project file). None of them seem to work still.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Fri Mar 07, 2014 6:42 pm

thanks for your kind guide.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests