2015-05-25 50 views
0

我在應用程序瀏覽器中有一個應用程序,它顯示了一個使用intel xdk的網站。在應用程序瀏覽器不會加載

網站加載在模擬器和我的Windows手機上的應用程序瀏覽器(但圖像不顯示),但它不會加載到我的iPad上。屏幕保持空白。

我的代碼:

<!DOCTYPE html> 
<html> 
    <!-- * Please see the included README.md file for license terms and conditions. --> 
    <head> 
     <title>Window.open</title> 
     <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
     <!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-  tutorials/quick-tip-dont-forget-the-viewport-meta-tag --> 
     <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;"/> 
     <style> 
      /* following two viewport lines are equivalent to meta viewport statement above, needed for Windows */ 
      /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */ 
      @-ms-viewport { width: 100vw ; min-zoom: 100% ; zoom: 100% ; }  @viewport { width: 100vw ; min-zoom: 100% zoom: 100% ; } 
      @-ms-viewport { user-zoom: fixed ; min-zoom: 100% ; }   @viewport { user-zoom: fixed ; min-zoom: 100% ; 
     </style> 
     <!-- Uncomment "phantom" cordova.js script if you convert your "Standard HTML5" project into a "Cordova" project. --> 
     <!-- <script src="cordova.js"></script> -->   <!-- phantom library, needed for Cordova api calls, added during build --> 
     <script src="js/app.js"></script>   <!-- recommended location of your JavaScript code relative to other JS files --> 
     <script src="xdk/init-dev.js"></script>  <!-- normalizes device and document ready events, see README for details --> 
     <script src="cordova.js"></script> 
     <script> 
      function openwin(){ 
       window.open('http://www.stackoverflow.com', '_blank', ''); 
      } 
     </script> 
    </head> 
    <body onload="openwin()">window open> 
    </body> 
</html> 

感謝

+0

你有哪個iOS版本?使用vw的寬度定義在iOS 6和7中有一些問題,並且早些時候根本不可用。當然只適用於iOS 8。 – mico

+0

我的測試設備是運行IOS8的iPad,它是iPad 2。 –

回答

0

其實這不是在官方的概念應用瀏覽,你只是扔掉你的代碼,並留下一些網頁來代替。它可以在webborwsers中正常工作,但是一旦不再有安全代碼,就會在HTML5應用程序中給你帶來一些問題。

一個在應用程序瀏覽器意味着你正在創建一些容器,並在這個容器內加載一些網站,這是一種安全的方式。

一旦您使用英特爾XDK,您可以嘗試的命令是:

intel.xdk.device.showRemoteSiteExt("http://www.stackoverflow.com",280,0,50,50,60,60);

This article可能是一個起點,以幫助您。並且this是我摘取的方法的描述。

相關問題