【问题标题】:where to include the jquery and jquery mobile libraries在哪里包含 jquery 和 jquery 移动库
【发布时间】:2012-11-19 17:38:58
【问题描述】:

我正在使用以下库:

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

如果我在&lt;HEAD&gt; 标记中包含上述内容,则应用程序将按预期工作。我的问题是,如果我在浏览器中打开同一个网页,在下载所有三个库之后,然后分别将它们包含在 CSS 和 JS 文件夹中,然后使用以下代码:

<script rel="external" type="text/javascript" src="js/jquery.js"></script>              
<script rel="external" type="text/javascript" src="js/jqm.js"></script> 
<link rel="stylesheet" type="text/css" href="css/jqm.css"/>

程序不工作。我已经尝试将它们包含在 body 标签的最后一行,但它仍然无法正常工作。

【问题讨论】:

  • 您确定您的路径和文件名正确吗?您也可以打包rel="external"
  • 你有什么目录结构?...如果你的“页面”嵌套得比你的根目录更深,上面的方法就行不通了。
  • @j08691 我试过没有 rel = "external" 仍然无法正常工作
  • 如果您的服务器上有这些文件,它必须是您的文件路径。
  • @scunliffe 该结构是一个名为 www 的桌面文件夹,其中包含 index.html 和 js 文件夹,其中包含 jq 和 jqm lib 以及 css 文件夹,其中包含 jqm css

标签: javascript jquery html cordova jquery-mobile


【解决方案1】:

是的,您可以将您的库存储在您的设备上,而且它也可以在没有互联网访问的情况下运行。
我曾经准备过一个示例,see here how to do it...

您的示例不起作用,因为您没有下载图标集。您必须将它们存储在子目录/images 中。你还必须使用 jQuery Mobile CSS 结构文件...

【讨论】:

    猜你喜欢
    • 2010-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    相关资源
    最近更新 更多