javascript - Cordova JQuery 错误 VS2015 : Exception: Cannot call method 'concat' of undefined

标签 javascript jquery cordova jquery-mobile visual-studio-2015

当我使用 jquery.mobile 加载 html 时,我在 VS 中收到此错误:

Exception: Cannot call method 'concat' of undefined

jquery.mobile-1.4.5js

我遵循了本教程:https://wordpress.org/support/topic/-this-xml-file-does-not-appear-to-have-any-style-information-associated 开始使用 jQuery。

这是抛出此异常的 html 示例:

<!DOCTYPE html>
<html>
<head>
    <!--
        Customize the content security policy in the meta tag below as needed. Add 'unsafe-inline' to default-src to enable inline JavaScript.
        For details, see http://go.microsoft.com/fwlink/?LinkID=617521
    -->
    <!--<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: http://api.openweathermap.org https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">-->

    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />
    <link rel="stylesheet" type="text/css" href="css/bb_Performance_Test_Page.css">
    <title>Performance</title>
</head>
<body>
    <div data-role="header" class="header">
        <h1 id="app-title">Performance</h1>
    </div>

    <button name="bb_prime_Button"
            onClick="bb_prime_Button_Click_Event()">
    Get Prime
    </button>
    <div class="prime">
        noData
    </div>
    <div class="time">
        noData
    </div>

    <script src="scripts/jquery-3.1.0.min.js"></script>
    <script src="scripts/jquery.mobile-1.4.5.min.js"></script>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="scripts/platformOverrides.js"></script>
    <script type="text/javascript" src="scripts/bb_Performance_Test_Page.js"></script>

</body>
</html>

我正在使用 Visual Studio 2015、混合 (Cordova) 应用项目、JQuery3.1.0 和 JQuery.mobile.1.4.5

最佳答案

jquery.mobile-1.4.5的部分功能与jquery-3.1.0不兼容。请使用jquery-2.2.4版本 。您可以从这里下载link

关于javascript - Cordova JQuery 错误 VS2015 : Exception: Cannot call method 'concat' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38632589/

相关文章:

Android - PhoneGap - 将启动画面设置为不拉伸(stretch)

ios - 如何在 Ionic 3 中打开静音/静音开关时播放音频?

javascript - IsotopeJS绝对定位

javascript - 如何更改图片在网页上的加载方式? (例如较低的分辨率)

cordova - 如何在 Phonegap 应用程序中获取 WiFi 网络信息 (SSID)?

javascript - 从 [ajax] 函数内部获取返回值

jquery - .click() 不起作用。 jQuery

javascript - 如何在 Angular 2 中重用服务调用

javascript - Selenium ,java,js "Exception in thread "主“org.openqa.selenium.JavascriptException : missing ) after argument list"

javascript - 使用PHP,Ajax和文本框刷新youtube嵌入代码