I’m using singe page concept jquery mobile.
I then create a dynamic listview like so:
var resultitems = '<ul data-role="listview">';
for (i = 0; i < 10; i++) {
if (msg.hotspots[i] != null) {
resultitems += '<li><a href="acura.html"><img src="' + msg.hotspots[i].imageURL + '" />' + msg.hotspots[i].title + '</a></li>';
}
}
resultitems += '</ul>';
$('#results').html(resultitems);
$('#results').trigger("create");
As you can see I have a hyperlink to acura.html now. But what I want is to activate a subpage #detailpage and load the details of the Id of the clicked item in the listview.
It’s no problem adding the item Id to the link, I just don’t know what the link should like and how to read the id from page #detailpage.
Thanks!
What I did now is not load the detailpage via the href attribute, but rather change the location.hash value with javascript via the onclick method of the hyperlink. This seems to make sure that the target detailpage always can read the actual querystring parameters.