Re: [問題] function參數的傳遞

看板Ajax作者 (葉酸酸)時間14年前 (2011/09/16 23:03), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
// jsbin: http://jsbin.com/omavun/1 javascript:(function() { "use strict"; var todo = []; function morning(text) { alert("morning" + text); } function zaoan(text) { alert("zaoan" + text); } function matenon(text) { alert("matenon" + text); } todo.push(morning); todo.push(zaoan); todo.push(matenon); function callbacks(data) { var length, cx, callback; data = /^\S+/.exec(data); length = todo.length; for (cx = 0; cx < length; cx++) { callback = todo[cx]; callback(data); } } $.get(location.href, callbacks); })(); -- Oni devas ami animalojn. Ili estas tiel bongustaj. One should love animals. They are so tasty. 每個人都應該愛動物,他們是如此美味。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.180.52.124

09/17 03:26, , 1F
實在是太感謝了QAQ 馬上來試試看QQ
09/17 03:26, 1F
文章代碼(AID): #1ESsL8ja (Ajax)
文章代碼(AID): #1ESsL8ja (Ajax)