Is .click() an actual mouse click? [duplicate]
Possible Duplicate:
Click source in JavaScript and jQuery, human or automated?
How can you check if a .click()
is an actual mouse click or you just are calling .click()
?
I don't think you can.
But you can instead use a different event, like mousedown
, but that could also be called manually as well.
Why do you need to differentiate between code-triggered and user-triggered events?
Set the action for the click event to call a function with the argument isClick=1. When you call the same function otherwise, call it with isClick = 0.
精彩评论