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

2011-02-07 Thread MRoderick
On Feb 4, 1:16 pm, Diego Perini diego.per...@gmail.com wrote: Using a setTimeout() for a pubsub implementation will work most of the time if the requirements are not too complex. I agree, and because of this, my implementation allows for both styles. Clearly, it could do with better

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

2011-02-07 Thread MRoderick
Hi Fran It would be great if you could share your results here. I am sure that others would benefit from your findings, and opinions on why you chose a specific implementation :-) /Morgan On Feb 4, 1:15 pm, Fran m...@fran.ie wrote: Looks great MRoderick, light and much quicker than jQuery

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

2011-02-04 Thread MRoderick
Hi Fran shameless-self-promotion You could go for completely independent PubSub implementatations as well, I wrote one: https://github.com/mroderick/PubSubJS http://roderick.dk/blog/2010/10/12/introducing-pubsubjs-a-library-for-doing-publish-subscribe-in-javascript/ http://jsperf.com/pubsubjs

[JSMentors] Re: jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-18 Thread MRoderick
Hmm ... more reports seem to suggest that the documentation on jslint.com is out of date. Bummer, I LIKED the onevar switch, allowing for gradual adoption. On Jan 17, 1:22 pm, MRoderick mor...@roderick.dk wrote: Anyone using jslint should really consider all the options available athttp

[JSMentors] Re: jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread MRoderick
Anyone using jslint should really consider all the options available at http://www.jslint.com/lint.html To switch off Crockfords opinion on only having one var declaration per function, add this to the top of the file you're working with: /*jslint onevar:false */ Since it's still in the

[JSMentors] Re: Good book after The Good Parts and High Performance JavaScript?

2010-12-15 Thread MRoderick
+1 for JavaScript Patterns An excellent book, covers a lot of practices that should be known by all JavaScript programmers On Dec 14, 1:16 pm, Adrian Olaru agol...@gmail.com wrote: IMO the next book you should read is  JavaScript Patterns by Stoyan Stefanov. Other good books are: