Я следую за плагинами/авторизацией JQUERY, и не могу понять, какие аргументы на строках 16 и 18 . Я упускаю что -то действительно фундаментальное? < /P>
(function( $ ){
var methods = {
init : function( options ) {
// ...
},
show : function( ) {
// ...
};
$.fn.tooltip = function( method ) {
// Method calling logic
if ( methods[method] ) {
return methods[ method ].
apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
}
};
})( jQuery );
Подробнее здесь: https://stackoverflow.com/questions/163 ... xplanation