0

我有我的剧本在这里,

 <script type='javascript'>
 $(LastRow).find('#delete').attr('onclick','Comment_Delete(event,'+cID+')')
</script>

<input type="image" id="delete" border="0" src="../Resource/images/commentcross.jpg";" style="border-width:0px;">

我希望控制呈现为,

<input type="image" id="delete" border="0" onclick="Comment_Delete(event,1048);"  src="../Resource/images/commentcross.jpg";" style="border-width:0px;">

即我想将onclick事件绑定到我的id=delete标签。我用我的生活作为,

$(LastRow).find('#delete').live('click','Comment_Delete(event,'+cID+')')

但在 chrome 中出现错误TypeError: Cannot call method 'replace' of undefined

4

2 回答 2

0

您是否尝试过这种方式:

$(document).find('#delete', LastRow).on('click', Comment_Delete('event',cID));

和这个:

$(document).on('click', '#delete' Comment_Delete('event',cID));
于 2012-12-28T07:11:33.987 回答
0

尝试这个,

$(LastRow).find('#delete').live('click', function() { Comment_Delete(event,cID ) } );
于 2012-12-28T06:41:29.960 回答