Click event not firing on a listview in jquery mobile
I've got a jquery mobile 1.0b1 website that populates a list via ajax.
After the list is populated I call开发者_Go百科
$('#theResults').listview();
The resulting HTML has the links each with a class "sresult" - what follows is a sample
<li><a class='sresult' href="#addResult">
<h3>title</h3>
<p>some content</p>
</a></li>
Now I have a live function that should THEORETICALLY bind a click event to these items. It works find in firefox... however on safari on my iPhone the click event does not fire
$('.sresult').live('click', function(event) {
event.preventDefault();
alert("i'm running!");
});
try vclick ( search for vclick http://jquerymobile.com/demos/1.0b1/docs/api/globalconfig.html )
$('.sresult').live('vclick', function(event) {
event.preventDefault();
alert("i'm running!");
});
instead of
$('.sresult').live('click', function(event) {
event.preventDefault();
alert("i'm running!");
});
精彩评论