title: function in javascript is not defined
body: <p>i have this js and qunit test below. why the browser gave me the listClasses is not defined? How to solve it. I saw mostly did </p>
  
  <pre><code>function ajax() {  
  $.ajax({   
  });}
  </code></pre>
  
  <p>but if i did like below how to do the test?  </p>
  
  <pre><code>$('#MregisteredClasses').on('pageinit', function listClasses(){
  var rowInput = "1";
  var pageInput = "1";
  
  $.ajax({
      url: 'http://137.57.102.146:8080/Training/getRegisteredClassesData.html',
      data: ( {rows : rowInput , page : pageInput}),
      type: 'POST',
  
      success: function(json_results){
      $('#list').append('&lt;ul data-role="listview" data-inset="true"&lt;/ul&gt;');
          listItems = $('#list').find('ul');
          $.each(json_results.rows, function(key) {
              html = "&lt;li data-mini='true' id='icon'&gt;&lt;a href='http://137.57.102.146:8080/Training/MRegisteredClassesDetail.phone?courseId=" 
                     + [json_results.rows[key].courseId] + "&amp;regNo=" + [json_results.rows[key].regNo] +
                     "' rel='external'&gt;" + json_results.rows[key].courseName+ "&lt;/a&gt;"
                     + "&lt;a href='http://137.57.102.146:8080/Training/MRateCourse.phone?courseId=" 
                     + [json_results.rows[key].courseId] + "&amp;regNo=" + [json_results.rows[key].regNo] + 
                     "' rel='external'&gt;RATE THIS COURSE&lt;/a&gt;&lt;/li&gt;" ; 
              listItems.append(html); 
          });
  
          $('#list ul').listview(); 
      },
  });
  });
  </code></pre>
  
  <p>and this is qunit test</p>
  
  <pre><code> test('asynchronous test', function() {  
  // Pause the test, and fail it if start() isn't called after one second  
  stop();  
  
  listClasses(function() {  
      // ...asynchronous assertions  
      ok(true, "Success"); 
  });  
  
  setTimeout(function() {  
      start();  
  }, 2000);  
  });  
  </code></pre>