2012-04-06 1 views
7

Non riesco a integrare Cordova (= PhoneGap) con Ember.js e jQuery Mobile. Ember.js + jQuery Mobile funziona correttamente, poiché il caricamento di index.html in qualsiasi browser desktop carica correttamente l'app.Qualcuno ha integrato correttamente Ember.js - PhoneGap (e jQuery Mobile)?

Utilizzando xCode 4 e il simulatore iPhone 5.1, non mostra alcun contenuto all'interno dei tag del manubrio. Il che significa che Ember.js non riesce a caricare.

index.html:

<html lang="en"> 
<head> 

    <title></title> 

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> 
    <meta charset="utf-8"> 

    <link rel="apple-touch-icon" href="/apple-touch-icon.png"> 

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> 

</head> 
<body> 
    <script type="text/x-handlebars" data-template-name="main"> 
    this text is NOT displayed 

    </script> 

    <div> this text IS displayed </div> 


    <script src="js/vendor/jquery.min.js"></script> 
    <script src="js/vendor/jquery.mobile.js"></script> 
    <script src="js/vendor/ember.js"></script> 
    <script src="js/app/app.js"></script> 
    <script src="js/vendor/cordova-1.5.0.js"></script> 
    <script type="text/javascript"> 

     // If you want to prevent dragging, uncomment this section 
     function preventBehavior(e){ 
      e.preventDefault(); 
     }; 
     document.addEventListener("touchmove", preventBehavior, false); 


     document.addEventListener("deviceready", onDeviceReady, false); 

     /* When this function is called, Cordova has been initialized and is ready to roll */ 
     /* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch. 
     see http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html 
     for more details -jm */ 
     function onDeviceReady(){ 
      // do your thing! 
     } 

    </script> 

</body> 
</html> 

risposta

3

trovato il problema. XCode riferiva:

ERROR whitelist rejection: url='http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css' 

seguito this, ho aggiunto *.jquery.com alla matrice ExternalHosts, all'interno Cordova.plist.

+1

Ti farò sapere, la tua app verrà rifiutata se stai ponendo la tua dipendenza da jQuery sulla connessione di rete. È possibile utilizzare la rete, ma è necessario disporre di alcune informazioni per consentire agli utenti di sapere perché una parte dell'app non funziona perché non hanno alcuna connessione. –

+0

css correzione - stessa cosa però. la tua app deve avere quel tipo di file caricati per poter essere approvata. –

+0

Grazie per il suggerimento. Non lo sapevo, ma intendevo rendere l'app completamente disponibile offline. –