简体   繁体   English

Phonegap连接插件Cordova.js包含多次

[英]Phonegap Connection plugin Cordova.js included multiple times

I've been trying to integrate phone gaps connection plugin to my project. 我一直在尝试将电话间隙连接插件集成到我的项目中。 So far i've had no luck. 到目前为止,我还没有运气。

i've successfully (I think) added the plugin using the CLI. 我已经成功使用CLI添加了插件。

But it still doesn't work. 但这仍然行不通。 I cecked the console and apparently än "Uncaught Error: cordova.js included multiple times." 我选择了控制台,显然是“未捕获的错误:cordova.js被多次包含”。 is thrown. 被抛出。 If i remove the script tag pointing to cordova.js. 如果我删除指向cordova.js的脚本标签。 It isnt loading at all. 它根本不加载。 And of course the console complains about that. 当然,控制台对此有所抱怨。

I dont get whats wrong. 我没有错。

My code: 我的代码:

<html>
<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <link rel="stylesheet" type="text/css" href="css/jquery.mobile.custom.structure.min.css" />
    <link rel="stylesheet" type="text/css" href="css/jquery.mobile.custom.theme.min.css" />
    <title>Skaderapportering</title>
</head>
<body>
    <div id=loader>
   </div>

   .... SOME APP CODE ...   
    <div id=titleBar><span class=offline></span><span rel=upd></span></div>     

    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.mobile.custom.min.js"></script>
    <script type="text/javascript" src="js/cordova_plugins.js"></script>
    <script type="text/javascript" src="js/cordova.js"></script>
    <script type="text/javascript" src="js/phonegap.js"></script>
    <script type="text/javascript" src="js/jquery.json-2.4.min.js"></script>
    <script type="text/javascript" src="js/jquery.md5.js"></script>
    <script type="text/javascript" src="js/jquery.base64.min.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript">
        app.initialize();
    </script>
</body>

I've tried all possible combinations with and without cordova_plugins.js. 我尝试了有和没有cordova_plugins.js的所有可能的组合。 EDIT: (Phonegap version 3.0.0-0.14.4) 编辑:(Phonegap版本3.0.0-0.14.4)

As far as I know, the old plugins will not work with the PhoneGap 3.0. 据我所知,旧的插件无法在PhoneGap 3.0中使用。

The new Plugin guide is here: http://cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html 新的插件指南在这里: http : //cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html

this repo can also help you: https://github.com/phonegap/phonegap-2-style-3 此仓库也可以帮助您: https : //github.com/phonegap/phonegap-2-style-3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM