Hi John!
> And this is even shorter, plus there's one less variable being defined:
>
> jQuery.fn.pluginMethod = function(settings) {
>     settings = jQuery.extend({
>         // stuff....
>     }, settings);
> };
>
> As noted previously - make sure that you use jQuery.extend() instead
> of $.extend().
>   
Thanks for correcting the $/jQuery issue, didn't see that.
>   
>> Credits for the options || {} idea go to Franck Marcia.
>>     
>
> Having to do that is no longer needed in SVN - I added a catch to see
> if a null or undefined value was being passed in and handled it
> gracefully.
>   
Cool, checking for arguments.length should make it pretty safe.
>> This is cool, but as plugin developer I cannot assume the latest jQuery
>> SVN version, right?
>>     
>
> Right - once this feature comes out (say, 1.0.3) then it would be more
> acceptable to require it. I guess you could always just be on the safe
> side and do || {}, at least until the release of 1.1 (to which
> everyone should upgrade).
>   
Well, actually not everyone should update. I think we need to start to 
roll on two tracks at some point. On one hand, we have to keep the API 
stable while fixing bugs. On the other hand, we have to evolve the API, 
to make it better in the long term.

Consider someone using 1.0.2 in a big project. He wants bugfixes and a 
stable API, he won't care much about new features. Consider someone else 
who wants to start a new project or add jQuery to an existing one, he 
wants an API at it's best.

I think it's very hard to provide both at the same time with only one 
branch. But I wouldn't mind if you have a nice solution at hand :-)

-- Jörn



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to