Chris Couper created CB-7150:
--------------------------------

             Summary: Error when using ajax on local file with Windows Phone
                 Key: CB-7150
                 URL: https://issues.apache.org/jira/browse/CB-7150
             Project: Apache Cordova
          Issue Type: Bug
          Components: WP8
    Affects Versions: 3.3.0
         Environment: Windows phone 8.1, jqm 1.4.3, jquery v1.10.2. Built using 
current version of Phonegap Build 
            Reporter: Chris Couper
            Assignee: Jesse MacFadyen


I have created a jquery mobile (1.4.3) app using phonegap build. It uses ajax 
get to load a local html file into a variable that I then inject into the body 
of the document. This happens by user selection long after device ready.

This works well with Android and iOS but comes up with an error on Windows 
Phone 8

On my config.xml I have allowed for CORS
<access origin="*" />

Also in the startup of the app I have:
                $(document).bind("mobileinit", function(){
                        $.extend(  $.mobile , {
                ajaxEnabled: false
                });
                        $.support.cors = true; 
                        $.mobile.allowCrossDomainPages = true;
                });


There is no error code returned, just the status of error. And the 
jqXHR.responseText is empty. The URL looks fine.

$.ajax({
 type: 'get',
 url: url,
 dataType:"html",
 beforeSend: function(jqXHR, settings) {
  jqXHR.url = settings.url;
 }
})
.done( function(data) {
$("#phone_frame .ui-content").html(data);
$(':mobile-pagecontainer').enhanceWithin();
 $(':mobile-pagecontainer').pagecontainer('change', '#phone_frame', {
  transition: 'slide',
  changeHash: true,
  showLoadMsg: true
 });                                    
}) // done
.fail(function(jqXHR, status, err){
 $.mobile.loading('hide');
 alert("Status:"+status+", error code:"+err);
});




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to