6

Is it possible to determine whether a given JavaScript action has been initiated by user? For instance I want to know whether a link was clicked by user or via jQuery fire event method?

Brian Tompsett - 汤莱恩's user avatar

Brian Tompsett - 汤莱恩

5,92772 gold badges64 silver badges135 bronze badges

asked May 10, 2011 at 9:58

mgamer's user avatar

1 Answer 1

13

event.which will be undefined if the event is triggered with code.

jsFiddle.

answered May 10, 2011 at 10:01

alex's user avatar

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved

Draft discarded

Sign up or log in

Sign up using Google

Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.