title: function call with this keyword is undefined
body: <p>I am calling local (class) function via <code>this</code> pointer, but get an error <code>'Uncaught TypeError: undefined is not a function'</code>. Probem occur on line 
  <code>this.createtimetable();</code> at <code>loadtimetable</code> function.</p>
  
  <p>My JS (relevant) is :</p>
  
  <pre><code>this.createtimetable = function () {
      this.inside_timetable = [];
      for (var d = new Date(in_week_start); d &lt;= new Date(in_week_end); d.setDate(d.getDate() + 1)) {
          console.log(new Date(d));
          daysOfYear.push(new Date(d));
      }
  }
  
  this.loadtimetable = function (in_guide_id, in_week_start, in_week_end) {
      this.guide_id = in_guide_id;
      this.week_start = in_week_start;
      this.week_end = in_week_end;
      $.post("./j.php", {
          guide_id : in_guide_id,
          week_start : in_week_start,
          week_end : in_week_end
      })
      .done(function (data) {
  
          var res_arr = jQuery.parseJSON(data);
  
          if (res_arr.code == 0) {
              this.excursions_base = res_arr.answer;
              alertify.success("Data extracted");
              this.createtimetable();
          } else {
              alertify.error("Some problem occured." + data);
          }
      }).fail(function () {
          alertify.alert("Error. Please, refresh page, or try later. We are sorry. Write or call us with your question!");
      });
  }
  </code></pre>
  
  <p>Calling by name (i.e. createtimetable() ) also fail. Thank you for ideas!</p>