0

Is this plugin pattern a good one ?

http://jsbin.com/isobar/12/edit

My goal was to have a global variable for each instance of the plugin, base, and the ability to call the same extern and intern method.

$('.my-plugin').myPlugin('myMethod', 'argument1', 'argument2');
or
base.myMethod('argument1', 'argument2');

Is there any specific compatibility problem or javascript errors?

1 Answer 1

1

Use jQuery Boilerplate and read this jQuery plugin template - best practice, convention, performance and memory impact.

Then start with this nice video: jQuery Plugin development.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.