Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery:- binding the function

 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried to bind keydown event on input with one function, but the second approach in code below does nothing on key down where as the first one triggers alert, what am i missing in second approach?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
$(".AutoComplete").bind("onkeydown",onAutoKeyDown);


"onkeydown"?

Think about it for a minute.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shoot...got it working, that was so dumb

but the question i have , is $(input).keydown(somefunction) an alternate way to bind somefunction on keydown event?


-P
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, for the frequently used event types, convenience methods are defined. They are entirely equivalent.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cool, thanks again Bear.

-P
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic