jQuery mobile creating table doesn't loop through xml correctly

PaTaYa

New Member
When I didn't have a class or anything my xml parsing was going through and looping, but I'm now trying to style it using jquery mobile. I have to create the list this way so that the styles get applied by jquery after load. But it's only loading the first result in the list. If i alert out $(this).text() I get 5 responses which is correct. But the following code isnt working.\[code\]$(document).ready(function() { $.ajax({ type: 'GET', url: 'test.xml', dataType: 'xml', success: function(xmlDoc) { var $xml = $(xmlDoc); $xml.find('FirstName').each(function() { $("#list").html('<li ><a href="http://stackoverflow.com/questions/10489566/acura.html">' + $(this).text() + '</a></li>'); $("#list").listview('refresh'); }); } }); });\[/code\]Heres the html:\[code\] <body> <div data-role="page"> <div data-role="header"> <h1>Deep Web</h1> </div><!-- /header --> <ul id="list" data-role="listview"></ul><!-- /content --> <div data-role="footer"> <h4>Footer content</h4> </div><!-- /footer --> </div> </body>\[/code\]
 
Back
Top