update($("span:first"),$("span:last"),bottonName);最后到底獲得的什么? function update(first,last,bottonName) {里面的first,last指的什么呢?
? ? <script type="text/javascript">
? ? //點擊更新次數
? ? $("button:first").click(function(event,bottonName) {
? ? ? ? bottonName = bottonName || 'first';
? ? ? ? update($("span:first"),$("span:last"),bottonName);
? ? });
? ? //通過自定義事件調用,更新次數
? ? $("button:last").click(function() {
? ? ? ? $("button:first").trigger('click','last');
? ? });
? ? function update(first,last,bottonName) {
? ? ? ? first.text(bottonName);
? ? ? ? var n = parseInt(last.text(), 10);
? ? ? ? last.text(n + 1);
? ? }
? ? </script>