How do I set up a basic link with jquery and productID
Hi all,
Currently I'm working on a Page that will list a collection of items
I am using jquery to loop through the results of the database query below.
I have it setup below to add the productID to the url and go to the 'product.html' page
If I wanted to send a POST instead, how can I set this up so that I can capture the value.productID when user clicks and capture the right product with value.productID - then go to the detail view page 'product.html'?
1 - maybe I should change from '<a href' to a click function that can get the product id and "post" to product page? How would I set that up?
2 - or whatever you suggest?
<div data-role="main" >
<ul id="list" data-role="listview">
</ul>
</div>
$.each(data, function(key, value) {
console. log ('item', key, value);
output += "<li><button>Get Contact List</button> - <a href=\"invoice.html?id=" + value.productID + "\">" + value.productID + "</a>" ;
output += " " + value.name + " " + value.price + "</li>";
});
$('#list').html( output );
$('#list').listview( "refresh" );
});
