title: Jquery ajax method always fires error: callback instead of success:
body: <p>I am having a problem when using the ajax function in jquery. The ajax call seems to be running fine, i.e. the code that is returning an xmldocument runs without errors. Here is that code.</p>
  
  <p><strong>Jquery code:</strong></p>
  
  <pre><code>function LoadWeekDays(){
      var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async="false";
      xmlDoc.loadXML("&lt;data&gt;&lt;item&gt;&lt;/item&gt;&lt;/data&gt;");
      var typeitem=xmlDoc.createElement("type"); 
      var employeeiditem=xmlDoc.createElement("employeeid");   
      var timesheetiditem=xmlDoc.createElement("timesheetid");
      typeitem.text = 1;
      employeeiditem.text = nemployeeid;
      timesheetiditem.text = ntimesheetid;
      xmlDoc.documentElement.firstChild.appendChild(typeitem);
      xmlDoc.documentElement.firstChild.appendChild(employeeiditem);
      xmlDoc.documentElement.firstChild.appendChild(timesheetiditem);
  
      $.ajax({
          type: "POST",
          url: "../ajax/BackPayLoadTables.aspx",
          data: xmlDoc.xml,
          dataType: "xml",
          success: function(xml) {
              alert('success');
          },
          error: function(){
              alert('error');
          }
      }); //close $.ajax(
  }
  </code></pre>
  
  <p><strong>BackPayLoadTables.aspx</strong></p>
  
  <pre><code>    Dim xmlDoc As New XmlDocument()
      Dim xmlDocRet As New XmlDocument()
      xmlDoc.Load(Request.InputStream)
      xmlDocRet = BackPayLoadTables(xmlDoc)
  
      Response.Clear()
      Response.Write(xmlDocRet)
      Response.End()
  </code></pre>
  
  <p>The BackPayLoadTables.aspx page calls a method BackPayLoadTables which returns an XMLDocument correctly. However when returning to the JQuery code it enters the error: callback for some reason instead of the success: callback. Any help on this would be greatly appreciated.</p>