jQuery $.live() doesn't work with table rows on the iPhone

被刻印的时光 ゝ 提交于 2019-12-04 14:37:20

One problem with this code is that you're using .live wrong - it should be called directly on the selector:

$('table tr').live( /* ... */)

From the specs:

DOM traversal methods are not fully supported for finding elements to send to .live(). Rather, the .live() method should always be called directly after a selector

Next, on jQuery 1.4.2, it's probably better to use delegate:

$('table').delegate('tr', 'click', function(){/* ... */} );
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!