2012-04-25 51 views
0

要更新下面的div:如何添加到 '數據角色= 「內容」' 在jQuery Mobile的

<div id="toadd" data-role="content"> 
     <p>Page 1 content</p> 
       <ul data-role="listview" data-theme="g"> 
    <li><a href="bmw.html">BMW</a></li> 
</ul> 
    </div> 

我使用:

$(document).ready(function() {     
      $("#toadd ul").append("<li><a href=\"acura.html\">tes</a></li>"); 
     } 
    }); 

的問題是,該鏈接被添加爲標準HREF:

enter image description here

如何更新代碼,以便「測試」使用相同的jQuery Mobile的造型爲'寶馬'在附圖中?

回答

1

嘗試$("#toadd ul").append("<li><a href=\"acura.html\">tes</a></li>").listview('refresh');

Check another post

+0

感謝,但應該是.listview( '刷新');而不是).listView('refresh'); – 2012-04-25 21:50:19

相關問題