I have the following HTML snippet contained in a listview. Each element in the listview begins with a thumbnail.
<li>
<a href="javascript:alert("don't want to see this alert);" >
<img src="/images/testimage_thumb.png" onclick="displayImage('/gallery/testimage.jpg');">
<h4>Test Image</h4>
<p>Description of test Image</p>
</a>
</li>
<li>
<a href="javascript:alert("don't want to see this alert either);" >
<img src="/images/testimage2_thumb.png" onclick="displayImage('/gallery/testimage2.jpg');">
<h4>Second Test Image</h4>
<p>Description of the Second Test Image</p>
</a>
</li>
Works like a champ (at least as far as displaying). I want to be able to have the users click on the thumbnail to display a larger image and NOT trigger the underlying anchor link (which in this case displays an alert message).
I'm sure the answer lies with preventDefault(), just not sure how to bind the click event to a function that will allow me access to the event object. There will be multiple thumbs in the listview and the list is generated dynamically in response to another event. I use the pagebeforeshow() event when then page is loaded to generate the list.