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 was the last time ben and I compared them ...

On 2/3/11 7:12 AM, Mads Erik Forberg wrote:
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 "$('body').bind/trigger" (or the other way around) if I wanted to use it as a PubSub ? Any different in terms of performance or others ?

Thanks


Hello,

maybe it's worth checking out this jQuery plugin for your pub/sub needs: https://gist.github.com/661855




--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to