1. Basic format for developing jQuery plug-ins
(function ($) {
$.extend($.fn, {
})
})(jQuery)
2. Develop global functions The basic format of
(function ($) {
$.extend($, {
})
})(jQuery)
Development example:
(function ($) {
$.extend($, {
subtract: function (a, b) {
return a-b;
}
,
add: function (a, b) {
return a b;
},
multiplication: function (a, b) {
return a*b;
},
division: function (a, b) {
return a b; )(jQuery)