Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery.on()双击传递数据_Jquery_Javascript Events_Event Handling - Fatal编程技术网

jquery.on()双击传递数据

jquery.on()双击传递数据,jquery,javascript-events,event-handling,Jquery,Javascript Events,Event Handling,使用时 $(document).on('dblclick', '#selector_id', {form_key:10}, my_function) my_function = function(){ console.log(event) } 我希望能够从事件中检索表单键。数据,如 但是,在这种情况下,我会得到一个MouseEvent,而不是事件,并且它没有数据属性 我缺少什么?添加您试图使用的参数,它可能会起作用: $(document).on('dblclick', '#sele

使用时

$(document).on('dblclick', '#selector_id', {form_key:10}, my_function)

my_function = function(){
    console.log(event)
}
我希望能够从
事件中检索
表单键
。数据
,如

但是,在这种情况下,我会得到一个
MouseEvent
,而不是
事件
,并且它没有
数据
属性


我缺少什么?

添加您试图使用的参数,它可能会起作用:

$(document).on('dblclick', '#selector_id', {form_key:10}, my_function)

function my_function(event){ // <- event
    console.log(event)
}

添加您试图使用的参数,它可能会起作用:

$(document).on('dblclick', '#selector_id', {form_key:10}, my_function)

function my_function(event){ // <- event
    console.log(event)
}