I'm working on a jQuery plugin, which is primarily a series of utility 
functions.  I need to worry about namespace problems, so I have opted 
for the option to add an object to the base jQuery object.

i.e.

jQuery.myObj = { . . .  };

What I'm not clear on is if this is the best approach.  Thus far 
everything is working fine, but that jQuery.fn.myObj approach and the 
jQuery.fn.extend() method are a little over my head (so far).  Are these 
better approaches to be using?

The methods I'm creating return various values - ints, dates, etc.  So I 
don't think the jQuery.fn.myObj approach would work here - it would 
break chaining.

So, I'm looking for any guidance you may be able to offer.  I'm the type 
that will plow through this anyways and make a choice where need be, but 
a second opinion is ALWAYS appreciated.. Just in case I'm doing things 
wrong... :)  Thanks in advance.

Shawn

Reply via email to