Jamsheed Kamarudeen
Jamsheed Kamarudeen

Reputation: 728

jquery mobile append does not work

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);

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?

Upvotes: 0

Views: 80

Answers (1)

Krish R
Krish R

Reputation: 22711

Try this, You have missed $ before (".content")

 $(".content").append(datatoinsert);

OR

$(".content").html(datatoinsert);

Upvotes: 1

Related Questions