有没有人成功整合Ember.js - Phonegap(和jQuery Mobile)?

时间:2012-04-06 17:06:07

标签: ios cordova ember.js

我正在努力将Cordova(= Phonegap)与Ember.js和jQuery Mobile集成。 Ember.js + jQuery Mobile工作正常,因为在任何桌面浏览器中加载index.html都会成功加载应用程序。

使用xCode 4和iPhone 5.1模拟器,它不会在车把标签内显示任何内容。这意味着Ember.js无法加载。

的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>

1 个答案:

答案 0 :(得分:3)

发现问题。 XCode正在报道:

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

关注this后,我在*.jquery.com内的ExternalHosts数组中添加了Cordova.plist