Problem with a plugin pattern

Problem with a plugin pattern

Hy

Why do I dont't get the alerts?


  1. (function($){

      $.myClassName = {

        calcSomething: function(obj){
               
          //do something
          alert('do something');
         
        },

        main: function(){
       
           alert('start');
          
           return this.each(function(){
                 
                  // I don't get this alert
                  alert('insite');
           });
           
           // I don't get this alert
           alert('end') ;
        }
      }

      $.fn.myMethod = $.myClassName.main; 
      $(".myclass").myMethod();
     
       
    })(jQuery);