Hi, I've noticed that when I click the Stop button on the browser, or
navigate to another page, jQuery.ajax calls the error event.

You can see the problem live at: http://www.pingmyport.com/

Code:

   this.getJson = function(timeout) {
      if(this.XMLHttpRequest) this.XMLHttpRequest.abort();
      this.XMLHttpRequest = $.ajax({
         complete: function(){$("#kitLoader").hide();},
         data: {
            Address: him.Address,
            portNum: him.portNum,
            portType: him.portType
         },
         dataType: "json",
         error: him.serviceUnavailable,
         success: him.processJson,
         timeout: timeout,
         type: "POST",
         url: "http://www.pingmyport.com/checkPort.php";
      });
   };

Reply via email to