我有以下一段代码:改变事件的执行顺序
<html>
<head>
<script src="myplugin.js" />
<script>
$(document).ready(function() {
$('#mytable tbody tr').live('click', function() {
alert('Hi');
});
});
</script>
</head>
<body>
<script>
$('#mytable').myplugin();
</script>
<table id="mytable">
<tbody>
<tr>
<td>Something</td>
</tr>
</tbody>
</table>
</body>
</html>
myplugin.js code
.....
return this.each(function(index, id) {
$(id + ' tbody tr').live('click', function() {
alert('Hello');
});
});
.....
根据该circustances,executiong的顺序将是:
alert('Hi');
alert('Hello');
,但我想是相反的。 可以更改执行顺序吗? 谢谢
不错,这工作:D – Diego 2010-12-20 16:00:56