<strong>以下代码,会先执行onclick,然后再执行事件监控</strong>: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="92278" class="copybut" id="copybut92278" onclick="doCopy('code92278')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code92278"> <br> <br> <br><title>JK Test</title> <br><meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <br><script src="http://s0.qhimg.com/lib/qwrap/110.js" type="text/javascript"></script> <br><style> <BR>div{border:1px solid balck;padding:5px;margin:2px;} <BR></style> <br> <br> <br><div id="div1" onclick="alert(1);">div1 原生的fireEvent,是先运行onclick,再运行listeners <br> </div> <br> <br><script type="text/javascript"> <BR>var fun=function(e){ <BR>alert('hello'); <BR>}; <BR>W('#div1').addEventListener('click',fun).fire('click'); //QW里调用的是原生方法 <BR></script> <br> <br> </div> <br><strong>JQuery的执行顺序恰恰相反</strong>: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="83992" class="copybut" id="copybut83992" onclick="doCopy('code83992')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code83992"> <br> <br> <br><title>JK Test</title> <br><meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <br><script src="http://s0.qhimg.com/lib/jquery/172.js" type="text/javascript"></script> <br><style> <BR>div{border:1px solid balck;padding:5px;margin:2px;} <BR></style> <br> <br> <br><div id="div2" onclick="alert(2);">div2 JQuery,先运行listeners,再运行onclick <br> </div> <br> <br><script type="text/javascript"> <BR>var fun=function(e){ <BR>alert('hello'); <BR>}; <BR>$('#div2').bind('click',fun).trigger('click'); <BR></script> <br> <br> </div> <br>扫了一下jq的trigger的实现,也没弄明白颠倒的目的是什么。