(function($){
$.fn.countdown = function(){
var current = 5;
function count(){
this.text(current);
}
count();
}
})(jQuery);
このプラグインでコンソール エラーが発生するのはなぜですかUncaught TypeError: Object [object global] has no method 'text'
。this
しかし、たとえばカウント関数の外側で変数として宣言し、var this_selected = this;
それをカウント関数内で使用すると、機能します。