2013-04-17 146 views

回答

1

索引文件不应该在服务器上。您需要在应用的资产文件夹中有一个index.html,并通过jquery ajax调用与服务器建立连接。 另外,还要确保您已导入科尔多瓦和PhoneGap的index.html中

3

javascript文件,因为剧本没有映射到库/ cordova.xxx你不如果从外部主机执行科尔多瓦脚本访问硬件资源一个Phonegap应用程序的jar。 但是你可以这样解决:

在res/XML/config.xml中

<access origin="*" /> 
<content src="index.html" /> 
资产

/WWW/index.html的

<body> 
    <script type="text/javascript" src="cordova-x.x.x.js"></script> 
    <iframe name="framewrap" id="framewrap" 
     style="border:0;position: absolute; top: 0; left: 0;width: 100%;" 
     src="http://yourwebsite.pl"> 
    </iframe> 
    <script type="text/javascript"> 
     document.getElementById("framewrap").contentWindow.navigator = navigator; 
    </script> 
</body> 

finaly

,在摄像头的配置,你如果你想要DATA_URL,必须将destinationType设置为0,如果你想要FILE_URI则设置为1,如果你想要NATIVE_URI则设置为2。我想帮你