Right now, I get a problem which is only mousedown
/mouseup
event can be captured but no mouse click event can be captured, how can I track the event to see what happen to it (like if it has been block, stop propagation etcs...)?
Asked
Active
Viewed 63 times
0

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Kuan
- 11,149
- 23
- 93
- 201
-
1http://stackoverflow.com/questions/19112999/chrome-firefox-set-breakpoint-on-all-javascript-onclick-events-at-once?lq=1 – mechalynx Jul 11 '14 at 23:36
-
@IvyLynx Thanks for help. But I have tried that, but it can not capture that click event. it looks like the click event was not get generated, so I want to track where is wrong. – Kuan Jul 11 '14 at 23:38
-
That would only happen if you prevented the click event in a script somewhere – adeneo Jul 11 '14 at 23:39
-
@adeneo Thanks for clue. Cos there are a lot of script, I can not read line by line to find out where the click prevention code located, could you tell me how to track the event passing flow to locate the prevention code? – Kuan Jul 11 '14 at 23:43
-
try to see if there's something like [event.preventDefault()](https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault) somewhere – mechalynx Jul 11 '14 at 23:45
-
@IvyLynx Thanks, I also have tried that, I have searched through all sciprt for preventDefault and stoppropagation etc.. but there is nowhere. – Kuan Jul 11 '14 at 23:50
-
are you using any jquery plugins or other libraries? maybe one of them is capturing the event instead or have some other event handler attached. – mechalynx Jul 11 '14 at 23:55
-
@IvyLynx no, I did not use jquery plugin, I only use D3.js. Even I can not solve this problem now, I wonder how can I know if this event has been generated or not? – Kuan Jul 11 '14 at 23:59
-
not sure but maybe these can give you some clue on what to look for: http://stackoverflow.com/questions/15515215/d3-js-need-click-event-in-d3-js - http://stackoverflow.com/questions/8238990/unable-to-get-click-event-in-d3-javascript-library?rq=1 – mechalynx Jul 12 '14 at 00:08
-
@IvyLynx thanks for help. I found some reason(but not sure). I add the click event listener on the fly when I generate those charts, but the generation code is located in the mouseup event handler, Is that because I generate new chart which lost the old event binding/reference? – Kuan Jul 12 '14 at 00:42
-
I don't know man, I haven't used d3.js but it might be something you're doing. Try to clean up the event handlers before you get rid of an old chart, it might help. – mechalynx Jul 12 '14 at 01:31