私は持っているjavascriptファイルを持っています
$.fn.comments = function (method) {
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 + ' doesn not exists in jQuery.comments');
return null;
}
};
モジュールから関数を返すイントロ requirejs チュートリアルを見てきました。
しかし、この JavaScript は $.fn に関数を追加します。requirejs を使用できるようにこのファイルを変更するにはどうすればよいですか?