-3

如果我单击或单击我的按钮锚标记。该页面不会加载新页面。这是我的代码。我正在使用最新版本的 Jquery mobile。这个问题从今天开始对我来说。

代码:

 $("a[href=#Page1").live("click",function()
 {
       updateList();
      //Will show a list and I called $("#list").listview("refresh");
 }

HTML:

有链接的页面:

  <div data-role="page" id="Page2">
      <div data-role="header">
       <h3> Header </h3>
       </div>
    <div data-role="content">
       <a role="button" href="#Page1"></a>
    </div>
</div>

页面过渡到:

<div data-role="page" id="Page1">
    <div data-role="header">
       <h3> Header </h3>
    </div>
    <div data-role="content">
       <ul data-role="listview" id="list" data-filter="true" data-filter-theme="true">
       </ul>
    </div>
</div>
4

1 回答 1

1

我不完全确定你想要做什么,但这里有一些工作代码:(你错过了]结束标签)

 $("a[href=#Page1]").live("click",function()
 {
       updateList();
      //Will show a list and I called listview.refresh();
 }

HTML:

<a href="#Page1">Link</a>
[...]
<div data-role="page" id="Page1">
<div data-role="header">
  Header
</div>

</div>
于 2012-09-26T16:05:22.193 回答