[JS] jq绑定事件的参数传递
$(function(){ var obj = {name:"select",param:"2"}; $("#select").click(obj,select); function select(event){ console.debug(event.data.param); } $("#select").change({msg: "ok"}, function(event) { myHandler(event.data.msg); }); });
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------