- 主题:如何找到DOM结点上挂载着的事件处理函数
could you explain your idea more clear?
【 在 XeCycle (据说是小 X) 的大作中提到: 】
: s/the function/the handler function/
--
FROM 116.247.85.*
function handler() {...}
// modify original code on $table
$table.find("tr").dblclick(handler);
// new code
$tr.dblclick(handler);
【 在 wuhaochi (oo) 的大作中提到: 】
: could you explain your idea more clear?
--
FROM 218.241.172.*
你这个是只针对一个$table,所以你知道这个$table的处理函数是handler
我上面已经给出了了函数声明,那就表示,这个$table是不确定的。自然不同的表对应不同的处理函数,所以我才有需要从$table里找处理函数。
你可以再理解一下我写那个函数声明的意图。
【 在 XeCycle (据说是小 X) 的大作中提到: 】
: 标 题: Re: 如何找到DOM结点上挂载着的事件处理函数
: 发信站: 水木社区 (Fri Jul 8 13:51:36 2016), 站内
:
: function handler() {...}
:
: // modify original code on $table
: $table.find("tr").dblclick(handler);
:
: // new code
: $tr.dblclick(handler);
:
: 【 在 wuhaochi (oo) 的大作中提到: 】
: : could you explain your idea more clear?
:
:
: --
:
: ※ 来源:·水木社区 newsmth.net·[FROM: 218.241.172.*]
--
FROM 116.247.85.*
you don't know what handler is on the element? then that design is
absolutely broken.
but anyway, you are apparently asking an X-Y question.
【 在 wuhaochi (oo) 的大作中提到: 】
: 你这个是只针对一个$table,所以你知道这个$table的处理函数是handler
: 我上面已经给出了了函数声明,那就表示,这个$table是不确定的。自然不同的表对应不同的处理函数,所以我才有需要从$table里找处理函数。
: 你可以再理解一下我写那个函数声明的意图。
: ...................
--
FROM 218.241.172.*
显然不是
别扯什么设计不设计
不知道就不知道,这没啥啊。 但你说人家X-Y就装过头了。
你回头再看看我的标题跟我的回帖。是你一直没明白人家在问什么。
如果仅仅以你认为的X,我自己知道。但我的确想问的是你现在认为的Y。
只是我一开始问的就是Y,要不你再读一遍标题理解一下?
【 在 XeCycle (据说是小 X) 的大作中提到: 】
: you don't know what handler is on the element? then that design is
: absolutely broken.
: but anyway, you are apparently asking an X-Y question.
: ...................
--
FROM 116.247.85.*
lol so you do not want to fix a broken design but go with dirty hacks?
go ahead, I do not know the answer and am not at all interested. maybe
dig into jquery sources; anyway I'd bet no sane library/framework will
ever recommend that.
【 在 wuhaochi (oo) 的大作中提到: 】
: 显然不是
: 别扯什么设计不设计
: 不知道就不知道,这没啥啊。 但你说人家X-Y就装过头了。
: ...................
--
FROM 218.241.172.*
lz,你这是鸡同鸭讲,没人搞得清楚你到底想干什么
上jsfiddle,写几行代码,写明白你的意图,然后把网址贴出来,大家才好理解
--
FROM 115.70.49.*
If the handler of $table.find("tr") binds no this, then you can do:
$tr.dblclick(function(){$table.find("tr").triggerHandler('dblclick');})
--
FROM 183.95.135.*
这个可以试试。
单从实现上说,我肯定有方法搞定。最不济就把函数存在各自的data()里。
【 在 ottffsse 的大作中提到: 】
: If the handler of $table.find("tr") binds no this, then you can do:
: $tr.dblclick(function(){$table.find("tr").triggerHandler('dblclick');})
--
FROM 61.171.89.*
chrome工具里都会显示各个节点上挂着的event listener.就问他是怎么做到的。
表达那么有出入吗?
【 在 cnxs 的大作中提到: 】
: lz,你这是鸡同鸭讲,没人搞得清楚你到底想干什么
: 上jsfiddle,写几行代码,写明白你的意图,然后把网址贴出来,大家才好理解
--
FROM 61.171.89.*