title: Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
body: <p>I'm getting this error and it is originating from jquery framework.
  When i try to load a select list on document ready i get this error.
  I can't seem to find why i'm getting this error.</p>
  
  <p>It works for the change event, but i'm getting the error when trying to execute the function manually.</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'toLowerCase' of undefined -> jquery-2.1.1.js:7300</p>
  </blockquote>
  
  <p>Here is the code</p>
  
  <pre><code>$(document).ready(function() {
      $("#CourseSelect").change(loadTeachers);
      loadTeachers();
  });
  
  function loadTeachers() {
      $.ajax({ 
          type: 'GET', 
          url: '/Manage/getTeachers/' + $(this).val(), 
          dataType: 'json', 
          cache: false,
          success:function(data) { 
              $('#TeacherSelect').get(0).options.length = 0;    
              $.each(data, function(i, teacher) {
                  var option = $('&lt;option /&gt;');
                  option.val(teacher.employeeId);
                  option.text(teacher.name);
                  $('#TeacherSelect').append(option);
              });
          },         
          error: function() { 
              alert("Error while getting results"); 
          }
      });
  }
  </code></pre>