0
(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;それをカウント関数内で使用すると、機能します。

4

2 に答える 2