What's a situation where you want to use .bind then? (still new at this)
Adam
Karl Rudd wrote:
The click, blur, keyup, etc functions are just shortcuts. So instead of:
$(...).bind( 'click', function...
you can write:
$(...).click( function...
Karl Rudd
--
View this
About the only reason is that the bind() function allows you to pass
a block of data into the handler function. The shortcut functions only
allow you to pass in a function.
For more info take a look at:
http://jquery.bassistance.de/api-browser/#bindStringObjectFunction
Karl Rudd
On 3/6/07,
agent2026 schrieb:
What's a situation where you want to use .bind then? (still new at this)
Adam
Maybe avoiding ambiguity. load() is used to either bind an event or load
content via XHR.
Also, if you want to attach custom events, you'll have to use bind.
$(elem).bind('triggerTab',
That's what I thought, and I had it in my head that it was actually phased
out and have been solely using .bind().
Seems like the best practice anyway. Thanks everyone for your explanations.
Adam
Chris Domigan wrote:
Also, I seem to remember (not sure though...) that there was some talk
The click, blur, keyup, etc functions are just shortcuts. So instead of:
$(...).bind( 'click', function...
you can write:
$(...).click( function...
Karl Rudd
On 3/6/07, Daemach [EMAIL PROTECTED] wrote:
--
View this message in context:
--
View this message in context:
http://www.nabble.com/What-is-the-difference-in-functionality-between-bind%28%29-and-click-blur-keyup-etc%28%29--tf3352982.html#a9324408
Sent from the JQuery mailing list archive at Nabble.com.
___
jQuery mailing
There is no difference. click(), keyup(), etc are just short cuts.
Chris
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/