【问题标题】:error jquery mobile错误jquery移动
【发布时间】:2013-02-13 21:11:45
【问题描述】:

我只是下载jquery mobile 1.2.0

http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js

但是我有这个错误 未捕获的类型错误:无法读取未定义的属性“msie”

当我在带有 phonegap 的 android 设备上运行项目时,我遇到了同样的错误

<!DOCTYPE HTML>
<html>
    <head>
        <title>PhoneGap</title>
        <link rel="stylesheet" href="css/jquery.mobile-1.2.0.min.css" />
        <link rel="stylesheet" href="css/jquery.mobile.structure-1.2.0.min.css" />
        <link rel="stylesheet" href="css/jquery.mobile.theme-1.2.0.min.css" />
    </head>
    <body>
    <h1>Hello PhoneGap !!!</h1>
    <script type="text/javascript" charset="utf-8" src="javascript/cordova-2.4.0.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascript/jquery/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="javascript/jquery/jquery.mobile-1.2.0.min.js"></script>
    </body>
</html>

谢谢

【问题讨论】:

    标签: javascript jquery-mobile


    【解决方案1】:

    根据本页:http://jquerymobile.com/test/#/test/docs/about/getting-started.html

    “jQuery Mobile 1.3 RC1 (1.3.0-rc.1) 适用于 1.7.0 到 1.9.0 的 jQuery 核心版本。”

    所以我的猜测是,如果您升级到 jQuery Mobile 1.3 RC1,您至少需要将 jQuery 核心降级到 1.9.0。

    对于 jQuery 1.2.0 看起来像 1.8.2:http://jquerymobile.com/demos/1.2.0/

    【讨论】:

    • 谢谢,它适用于 1.3 bur 使用这个版本有很多风险吗?
    • 我有限的经验是 jQuery mobile 对核心版本非常敏感。这就是为什么这个答案这么快。我自己也遇到过。
    【解决方案2】:

    你可以添加

    jquery-migrate-1.1.1.min

    <script src="~/Scripts/jquery-migrate-1.1.1.min.js"></script>
    

    到您的引用脚本列表

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多