【问题标题】:Jquery mobile load local html pagejquery移动加载本地html页面
【发布时间】:2011-11-02 04:41:52
【问题描述】:

我想用 jquery mobile 做一件简单的事:

我有一个适用于 android 的离线网络应用程序(使用 phonegapp 和 jquery mobile)

我为我的本地 html 文件做一个链接列表:

 <ul data-role="listview"  id="mylist">
            <li><a href="./information.html">Information</a>   </li></ul>

当我点击链接时,我的文件 information.html 没有显示,显示的生成的 html 页面如下所示:

<div style="min-height: 965px;" class="ui-page ui-body-c ui-page-active"
 data-url="[fullpath]/information.html" data-role="page">undefined</div>

显示的内容不是来自information.html

(i have also tried with  <li><a href="#information">Information</a>

但结果是一样的……

你有什么想法吗?

谢谢。

【问题讨论】:

    标签: jquery html web-applications mobile jquery-mobile


    【解决方案1】:

    据我了解,jQuery Mobile 试图自动做一些花哨的事情。如果您不希望它这样做,请将rel="external" 放在您的链接标签中。所以这可能有效:

    <a href="./information.html" rel="external">
    

    【讨论】:

    • 谢谢,它正在工作,不幸的是,这里 information.html 需要重新加载所有 jquery + jquery-mobile 并且似乎需要很长时间......我已经用 href= 完成了测试“#other_page”,当然是高性能的,但是通过重新加载所有页面+ jquery +其他库,性能很差:(我不知道是否有办法让jquery解释加载的页面而不在加载的代码中加载库...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-13
    • 1970-01-01
    • 1970-01-01
    • 2013-10-13
    • 1970-01-01
    • 1970-01-01
    • 2013-11-17
    相关资源
    最近更新 更多