2012-04-25 61 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

相关问题