"e"在此函数定义中的含义是什么?

xan*_*r27 9 html javascript jquery

我可以将其他参数传递给此函数吗?

$("#foold").click( function(e) {
  // CODE
};
Run Code Online (Sandbox Code Playgroud)

例如,我需要将一些X值传递给此函数.我可以写这样的东西:

<a href="javascript:void(X)" id="fooId">Foo</a>
Run Code Online (Sandbox Code Playgroud)

通过e或其他方式传递此函数中的值?

Sir*_*ius 11

这里e是一个事件对象,如下所示:http://api.jquery.com/category/events/event-object/

是的,您可以使用此表单为click函数将数据传递给处理程序:

.click( [eventData], handler(eventObject) )

eventData             A map of data that will be passed to the event handler.
handler(eventObject)  A function to execute each time the event is triggered.
Run Code Online (Sandbox Code Playgroud)

它将e.data在处理程序中可访问.