Hi,

Below, I have 2 functions: getAllDetails() and getDetails(id)
My first function "getAllDetails()" works fine, this returns a list.
I would now like to add the ability to be able to click on a list item and pass through the 'trackid' to get to the details page?

Please help, I am almost there...



Code:
function getAllDetails()
{
var myTable = '' ;
myTable += '<ul class="ui-listview" data-role="listview">' ;


var url = "http://www.trialsevolution.co.uk/mobileapp/json-example2.php";
  $.getJSON(url, function(json) {
           i=1;
                $.each(json, function(k, v) { 	

				myTable +=   "<li data-corners='false' data-shadow='false' data-iconshadow='true' data-wrapperels='div' data-icon='arrow-r' data-iconpos='right' data-theme='c' class='ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-c'><div class='ui-btn-inner ui-li'><div class='ui-btn-text'><a href='"+v.trackid+"' class='ui-link-inherit'>"+v.trackname+"</a></div><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></div></li>";   

                });
                myTable += '</ul>' ;
				$("#stud_tbl").html(myTable) ;
				
        });
}


function getDetails(id)
{
var myTable = '' ;
var id_val = id.value;

var url = "http://www.trialsevolution.co.uk/mobileapp/json.php?id="+id_val;
  $.getJSON(url, function(json) {
                var select = $('#city-list');
                $.each(json, function(k, v) {    
                  myTable +=   "<ul><li>"+v.trackname+"</li><li>"+v.trackcreator+"</li></ul>";    
                });
				$("#stud_tbl").html(myTable) ;
				
        });
}