Javascript/jQuery: Varying parameters on a custom function

Posted by dclowd9901 on Stack Overflow See other posts from Stack Overflow or by dclowd9901
Published on 2010-03-27T20:47:58Z Indexed on 2010/03/27 20:53 UTC
Read the original article Hit count: 202

Filed under:
|
|
|

I'm writing a plugin that will allow parameters to 'set it up.' But I predict the user won't always want to set up every aspect of the function.

function This_Function(a,b,c,d);

For instance, maybe they'll only want to set up a and c, but not b and d (they'll just prefer to leave those as defaults). How do I write the function (or the parameters for that matter) so that the user can customize which functions they would prefer to pass? I have a feeling it involves parsing input, but I've seen many other functions with this capability.

Thanks in advance for the help.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery