title: Object function work first time but return undefined the second time
body: <p>My code works fine for the first time but the second time, my object functions returns undefined.</p>
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>_MANAGE = new Object()
  //----------------------------- BG ------------------------------//
      var saveBg = {
          name    : "bg",
          url     : "AN URL",
          data : {
              ID     :function($this){ return $this.parents("tr").data("id") },
              name   :function($this){ return $this.parents("tr").find(".name").val() }
          }
      }
      
  //----------------------------------------------------------------------//
  //------------------------- SAVE FUNCTION ------------------------------//
  
      var saveButton = [saveBg];
  
      $(".buttonSave").on("click", function(){
          console.log(saveBg);
          var buttonName   = $(this).data("name");
          
          _MANAGE.saveButton(saveButton, buttonName, $(this));
      })
      
  //----------------------------------------------------------------------//
  //------------------------- SAVE BUTTON ------------------------------//
  _MANAGE.saveButton = function(saveButton, buttonName, $this_button){
          for(var i = 0; i &lt; saveButton.length; i++){
              if(buttonName == saveButton[i]["name"]){
                  for(var param in saveButton[i]["data"]){
                      if(typeof(saveButton[i]["data"][param]) == "function"){
                          saveButton[i]["data"][param] = saveButton[i]["data"][param]($this_button);
                      } else {
                          saveButton[i]["data"][param] = $(saveButton[i]["data"][param]).val();
                      }
                  }
                  if(!saveButton[i]["success"]){
                      saveButton[i]["success"] = function() {
                          $this_button.children()
                          .hide()
                          .replaceWith("&lt;span style='font-size:0.7em;''&gt;Saved&lt;/span&gt;").fadeIn("slow");
                          setInterval(function(){
                              $this_button.children().hide().replaceWith('&lt;span class="icon-floppy"&gt;    &lt;/span&gt;').fadeIn("slow");
                          }, 1500);
                      } 
                  }
                  _MANAGE.ajaxButton(saveButton[i]);
              }
          }
      }
  
  //----------------------------------------------------------------------//
  //------------------------- ASYNC FUNCTION ------------------------------//
      _MANAGE.ajaxButton = function(ajaxButton) {
         
          var stringData = "";
          if(ajaxButton.data){
              var loop = 0;
              for(var param in ajaxButton["data"]){
                  if(loop == 0){
                      stringData += param + "=" + ajaxButton["data"][param];
                  } else {
                      stringData += "&amp;" + param + "=" + ajaxButton["data"][param];
                  }
                  loop++;
              }
          }
     
          if(ajaxButton.url &amp;&amp; ajaxButton.success &amp;&amp; stringData != "") {
              $.ajax({
                  url      : ajaxButton.url,
                  data     : stringData,
                  dataType : "text",
                  success  : ajaxButton.success
              });
          }
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--THE TABLE --&gt; 
  &lt;tr data-id="4"&gt;
     &lt;td&gt;&lt;b&gt;4&lt;/b&gt;&lt;/td&gt;
     &lt;td&gt;&lt;input class="name" type="text" value="A VALUE"&gt;&lt;/td&gt;
     &lt;td&gt;
       
       &lt;!-- THE BUTTON --&gt;
       &lt;div class="buttonSave" data-name="bg"&gt;
        &lt;span class="icon-floppy"&gt;&lt;/span&gt;
      &lt;/div&gt;   
       
     &lt;/td&gt;   
  &lt;/tr&gt;</code></pre>
  </div>
  </div>
  </p>