jQuery Mobile的追加不起作用 [英] jquery mobile append does not work
本文介绍了jQuery Mobile的追加不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用jQuery Mobile的开发一个Android应用程序,我有这个code附加上一个Ajax调用作为列表中检索一些数据..
在这里头的部分。
I am using jquery mobile to develop an android app and i had this code to append some data retrieved on an ajax call as a list.. a portion in head here..
var datatoinsert = "<ul data-role=\"listview\"><li>Faculty ID: "+ $.urlParam('id') + "</li><li>Name: "+data.name + "</li><li>Phone : "+
data.phonenumber +"</li><li>Faculty Since :" + data.since + "</li><li> Qualification :" + data.qual + "</li></ul>";
alert(datatoinsert);
(".content").append(datatoinsert);
这是将数据插入到体内的div ..
It was to insert the data to a div in body..
<div class= "content" data-role="content">
</div>
但它没有这样做,警报工作相当精细..我看到,我得到所有需要的数据..但它似乎没有显示在屏幕上。任何事情,我错过了什么?
But it fails to do so, the alert works quite fine.. and i see that i get all the data required.. but it doesnt seem to show up on screen. any thing I missed?
推荐答案
试试这个,你已经错过了 $
在(内容)
Try this, You have missed $
before (".content")
$(".content").append(datatoinsert);
或
$(".content").html(datatoinsert);
这篇关于jQuery Mobile的追加不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文