title: Ajax request not working in Safari, Chrome
body: <p>I have an ajax request that fires when a link is clicked to download a file.  A server-side page  is called that updates a database with the customer ID and file name that the visitor has downloaded.  Using Jquery 1.5.1.  Here's the link html:</p>
  
  <pre><code>&lt;a href="/downloads/whatever.zip" class="software"&gt;click here to download&lt;/a&gt;
  </code></pre>
  
  <p>The ajax request is written as follows, and contains a function to notify if there's an error in the ajax request:</p>
  
  <pre><code>$(document).ready(function() {
    //function to alert an error message if request is unsuccessful
    function ajaxError(request, type, errorThrown)
    {
    var message = "There was an error with the AJAX request.\n";
    switch (type) {
        case 'timeout':
            message += "The request timed out.";
            break;
        case 'notmodified':
            message += "The request was not modified but was not retrieved from the cache.";
            break;
        case 'parseerror':
            message += "XML/Json format is bad.";
            break;
        default:
            message += "HTTP Error (" + request.status + " " + request.statusText + ").";
    }
    message += "\n";  
    alert(message);
    }
  
  
  $('a.software').click(function() {  
  //get the path of the link, and just the file name to be stored in the database
  var filePath = $(this).attr("href");
  var partsArray = filePath.split('/');
  var theFileName = partsArray[partsArray.length-1];
  
  
    $.ajax({
       type: "POST",
       url: "/validate/softwareDownloadedCustomer.asp?custID=&lt;%=custID%&gt;&amp;fileName=" + theFileName,
       success: function(msg) {
        alert("Success");
       },
       error: ajaxError
      });
    }); 
  });
  </code></pre>
  
  <p>The server side code is not the problem, it works as expected when called simply by another page and not an ajax request.  Strangely, the ajax request works in Firefox and IE, but not in Chrome and Safari.  In IE, a 'success' message is alerted and the database is updated.  In Firefox, Chrome and Safari, my error message that is alerted is as follows:</p>
  
  <pre><code>There was an error with the AJAX request.
  HTTP Error (0 error)
  </code></pre>
  
  <p>Even though the error message is received in firefox, it updates the database.  In chrome and safari, the error message is received and nothing is updated.  </p>
  
  <p>I've tried using the following settings in my ajax call, and it didn't seem to make a difference in any of the browsers:</p>
  
  <pre><code>contentType: "application/json; charset=utf-8",
  dataType: "json", 'data' 
  </code></pre>
  
  <p>What am I missing to get this to work in Safari and Chrome?</p>