title: ajax redirect if host not found
body: <p>How do I redirect a client page if the host is unreachable?  My code works if host is reachable but does nothing when it isn't:</p>
  
  <pre><code>$(document).on('pagebeforeshow', '#index', function(){      
      $.ajax({url: "http://www.espnsdsd.com",
              dataType: "jsonp",
  
              complete: function(e, xhr, settings){
      if(e.status === 200){
          window.location.replace('http://www.espn.com'); 
  
      }else{
          window.location.replace('http://www.anotherespn.com'); 
      }
  }
  
  
       });
  });    
  </code></pre>