Hi Mike,

Thanks! all good suggestions. I went with
 $('#someid').myPlugin({
     doThis: ...,
     doThat: ... });
One entry point, and lets me doThis and doThat both, which turned out
to be useful.

I'm still curious whether my original syntax could be made to work. I
suspect the answer is "not easily".

Marion

On Dec 13, 5:14 am, Mike Alsup <[email protected]> wrote:
> > I'm trying to create a plugin with two entry points. You would use it
> > like this:
>
> > $('#someid').myPlugin.doThis(options);
> > $('#anotherid').myPlugin.doThat(options);
>
> How about one of these approaches instead:
>
> $('#someid').myPluginDoThis(options);
> $('#anotherid').myPluginDoThat(options);
>
> or
>
> $('#someid').myPlugin('doThis', options);
> $('#anotherid').myPlugin('doThat',options);
>
> or
>
> $('#someid').myPlugin({
>     action: 'doThis'
>     /* other options */});
>
> $('#anotherid').myPlugin({
>     action: 'doThat'
>     /* other options */
>
> });

Reply via email to