0

I have a bind event like:

$(document).on('click', selector, proxy);

what is the difference between "click with mouse" and "do a trigger XXX.trigger('click');" what is their principle in calling callback function?

Geeky Ninja
  • 6,002
  • 8
  • 41
  • 54
Frankjs
  • 565
  • 1
  • 4
  • 14
  • possible duplicate of [Difference between .click() and actually clicking a button? (javascript/jquery)](http://stackoverflow.com/questions/11127908/difference-between-click-and-actually-clicking-a-button-javascript-jquery) – Karlen Kishmiryan Apr 25 '14 at 06:46

1 Answers1

0

Both are almost same, but click() is shorthand of trigger('click').

More info here.

I found this info too, in stackoverflow.

Community
  • 1
  • 1
Andynedine
  • 441
  • 5
  • 20
  • thanks, but what i asked is "live mouse click" and "trigger('click')". i think it is different between these two ways. or you think a mouse click is same as call the click() function? – Frankjs Apr 25 '14 at 06:58
  • I think so. To make 'click' you must do it with mouse. With trigger is the same (in my second ref. is explined), but you could "schedule" an event to make click too. – Andynedine Apr 25 '14 at 07:38