Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Mads Erik Forberg
Den 03.02.2011 13:03, skrev Fran: Hi guys, I know this is more jQuery related question and perhaps it'd be better to ask in its forum but I'll drop it in case some jQuery experts in this group could answer it. Is there any reason why I should be using $(document).bind/trigger over

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Peter Higgins
That plugin is essentially the same thing as using $(body).trigger/bind, has the overhead of going through the event system and is actually larger by a few bytes* than my simplified version: https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js ~phiggins * or at least it

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Peter Higgins
it would only really matter if you were triggering dom events. Also, the point about it going the event system and bubbling and whatnot still is valid. ~phiggins On 2/3/11 7:38 AM, Fran wrote: I like this really tiny but clever plugin. I'll definitely keep it in mine, but still I have the

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Poetro
2011/2/3 Fran m...@fran.ie: I like this really tiny but clever plugin. I'll definitely keep it in mine, but still I have the question whether using $(document) or $('body') makes any different. Any idea ? There is one small difference. The $(document) selector is a bit faster. I dont think

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Peter Higgins
On 2/3/11 9:12 AM, Poetro wrote: 2011/2/3 Franm...@fran.ie: I like this really tiny but clever plugin. I'll definitely keep it in mine, but still I have the question whether using $(document) or $('body') makes any different. Any idea ? There is one small difference. The $(document) selector

RE: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Joel Dart
to your app than bouncing events off the dom anyway. -Original Message- From: jsmentors@googlegroups.com [mailto:jsmentors@googlegroups.com] On Behalf Of Fran Sent: Thursday, February 03, 2011 10:07 AM To: jsmentors@googlegroups.com Subject: Re: [JSMentors] $('body') vs $(document) in Pub

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Fran
@googlegroups.com Subject: Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern Because I'd also like to use namespaced events and I think jQuery has this cleverly implemented On 03/02/11 15:00, Peter Higgins wrote: On 2/3/11 9:12 AM, Poetro wrote: 2011/2/3 Franm...@fran.ie: I like this really tiny