<table style="width: 100%;" class='table_result'>
<tr><td>Text</td><td>Text</td><td>Text</td><td>Text</td><td>Text</td><td>text</td></tr>
</table>
然後,當按鈕被點擊我把這個
$("table.table_result").append('<tr class="topRow" style="height: 35px;">
<td 'style="text-align: center; cursor: pointer">'+ text
+'</td><td style="text-align: center">'
+'<input class="control_voteUp" type="button" value="Up">'
+ text
+'<input class="control_voteDown" type="button" value="Dn">' +'</td><td style="text-align: center">'+ text +'</td><td style="text-align: center">'+ text
+'</td><td style="text-align: center">'+ text
+'</td><td style="text-align: center">'+ text +'</tr>');
所以我想,當點擊control_voteUp
調用一個函數。
我曾嘗試以正常的方式和其他沒有更迭:
$('input.control_voteUp').click(function()
{
alert("aa");
});
$('input.control_voteUp').delegate('input', 'click', function()
{
alert("aa");
});
$('input control_voteUp').live('click', function()
{
alert("aa");
});
任何解決方案?
呀它工作!!我讀了http://stackoverflow.com/questions/3072441/jquery-live-doesnt-work-with-table-rows-on-the-iphone,它沒有點,所以我嘗試了這種方式。我的壞 – gerarddp