Dynamically Appending Elements to jQuery Mobile ListView

后端 未结 5 2050
执念已碎
执念已碎 2020-12-15 12:45

I want to dynamically append data received via an url in JSOn format to my listview. But i can\'t figure out how it works.

The mobile website retrieve the object in

5条回答
  •  醉酒成梦
    2020-12-15 13:09

    I think the issue you might be encountering is that the JSON being returned is an object wrapped in an array. To parse you will have to iterate through the array first:

    for( var x = 0; x < data.length; x++ ) {
     var i = data[ x ];
     i.title.appendTo("#listview");
    }
    

提交回复
热议问题