You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Chris Couper (JIRA)" <ji...@apache.org> on 2014/07/25 07:30:38 UTC

[jira] [Commented] (CB-7150) Error when using ajax on local file with Windows Phone

    [ https://issues.apache.org/jira/browse/CB-7150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14074088#comment-14074088 ] 

Chris Couper commented on CB-7150:
----------------------------------

Thanks. I see  I can force 3.5 now in Phonegap and will try it to see if its resolved.

http://community.phonegap.com/nitobi/topics/cordova_3_5_0_now_on_phonegap_build

> 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, jqm 1.4.3, jquery v1.10.2. Built using current version of Phonegap Build 
>            Reporter: Chris Couper
>            Assignee: Jesse MacFadyen
>              Labels: ajax, cordova-js, javascript, jquery, mobile, phonegap, windows-phone
>
> 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)