aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes jquery:- binding the function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery:- binding the function" Watch "jquery:- binding the function" New topic
Author

jquery:- binding the function

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 635
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?



All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

$(".AutoComplete").bind("onkeydown",onAutoKeyDown);


"onkeydown"?

Think about it for a minute.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 635
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

Joined: Jan 10, 2002
Posts: 61221
    
  66

Yes, for the frequently used event types, convenience methods are defined. They are entirely equivalent.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 635
cool, thanks again Bear.

-P
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jquery:- binding the function