Assistance needed with listview and passing data when clicked to a new page.

Assistance needed with listview and passing data when clicked to a new page.

I have a list of items that is dynamically pulled from a web service.

It looks like this:





What I want to happen, is I want the list item that is clicked, to somehow be declared as a variable....and the information for the clicked item, to be passed onto another page. I have no idea how to go about doing this, and was hoping someone here can point me in the right direction.


So far I have been able to come up with this, but the variable 'someData' keeps coming back undefined.

  1. $('#dogs ul').click(function(e) {
  2.   var someData = jQuery(this).data('<li>');
  3. alert(someData);
  4.  });
  5.   }




Here is the code that brings all the information together into the listview:

  1. $(data).find('NewDataSet').each(function(i){
  2. var listView = $('<ul data-role="listview" data-inset="true" data-split-theme="b">').data('role', 'listview');
  3. $(data).find('Table').each(function(){
  4.     var title = $(this).find('ShortDesc').text();
  5.     var description = $(this).find('LongDesc').text();
  6. var thumbnail = $(this).find('ThumbURL').text();
  7.  
  8. var listItem = $('<li/>');

  9. $('<a href="#"><img id="bla" src="'+ thumbnail +'"><div id="desc"><h4>'+title+'</h4><p><br/>'+description+'</p> </div>').appendTo(listItem);

  10.    
  11.    
  12.     
  13.     $(listItem).appendTo(listView);
  14. });
  15. $(listView).appendTo('#dogs');
  16.     });
  17. $('#dogs ul').listview(); 







If anyone could point me in the right direction, or show me what I'm doing wrong it'd be greatly appreciated. 


Thanks!