click事件的用法
? ? ? ? //不同函數(shù)傳遞數(shù)據(jù)
? ? ? ? function data(e) {
? ? ? ? ? ? alert(e.data) //1111
? ? ? ? }
? ? ? ? function a() {
? ? ? ? ? ? $("button:eq(2)").click(1111, data)
? ? ? ? }
? ? ? ? a();}
這個函數(shù)?$("button:eq(2)").click(1111, data)中data指的是上面的函數(shù)名嗎?具體怎么執(zhí)行的,麻煩大神解釋下!
2016-08-18
沒錯,data是指的 function data(e)這個函數(shù)。具體執(zhí)行就是:在click事件中,將參數(shù)(1111)傳入并調(diào)用data函數(shù)
2016-08-18