I am using an xml file to pull in data to jqm. I am appending the first and last name to a listview. (I am working with Datazombies example for the a-z index contact list from the iscroll git hub). How would I specify where to append ie, if the lastname is Adams (or anything that begins with letter A) Adams is appended under the listdivider with ID of A.
Sorry about that thought I included code
$.ajax({
type: "GET",
url: "Contacts.xml",
dataType: "xml",
success: ContactsXml,
});
function ContactXml (lxml) {
$(lxml).find("COMBINED").each(function() {
$("#A").append('<li id="item"><a href="#ldetails">'
+ $(this).find("FIRSTNAME").text() + ' '
+ $(this).find("LASTNAME").text() + '</a></li>');
})}
</script>
<div id="header" data-role="header" data-backbtn="true">
<a href="#page" data-role="button" data-icon="arrow-l">BACK</a><h1>CONEX</h1></div>
<div>
<!-- //left scroll-->
<div id="wrapper" style="overflow-x: hidden; overflow-y: hidden; ">
<div id="scroller" style="-webkit-transition-property: -webkit-transform; -webkit-transition-
<ul id="thelist">
<li class="heading" id="A"><span>A</span></li>
<li id="item"></li>
<li class="heading" id="B"><span>B</span></li>
<li class="heading" id="C">C</li>
<li class="heading" id="D">D</li>
<li class="heading" id="E">E</li>
<li class="heading" id="F">F</li>
</div>
Well your question is completely void of any sample markup or script, so here’s a general approach:
JS:
HTML: