title: Can I test if URL is reachable using AJAX + cross-domain + jsonp?
body: <p>I'm using JQuery to fetch information from an URL and display it on my page asynchronously. The URL comes from other domain, so I use JSONP to get the data. That works fine.</p>
  
  <p>However, when the remote URL is down (which happens once in a while) my page hangs as <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">JQuery AJAX</a> doesn't call the 'success' or 'error' functions.</p>
  
  <p>I'm using JQuery 1.7.</p>
  
  <p>My code looks like:</p>
  
  <pre><code>    $.ajax({
          type : "GET",
          url : "http://otherdomain.com/somePage.html",
          data : params,
          dataType : "jsonp",
          jsonp : "jsonp",
  
          success : function (response, textS, xhr) {
              alert("ok");
          },
          error : function (xmlHttpRequest, textStatus, errorThrown) {
              alert("not ok " + errorThrown);
          }
      });
  </code></pre>
  
  <p>If "somePage" is up, then I see the message "ok". If "somePage" is not reachable, then I don't see anything.</p>
  
  <p>Any ideas on how can I get "error" function get called? Or more importantly, how to detect if the cross-domain URL is reachable?</p>
  
  <p>Is that even possible?</p>
  
  <p>Thanks,</p>