title: Redirect to another domain using jquery ajax
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12540846/jquery-ajax-redirect-to-another-domain">jquery (ajax) redirect to another domain</a>  </p>
  </blockquote>
  
  
  
  <p>I have the jQuery Ajax request in the following format:</p>
  
  <pre><code>$.ajax({
          url: 'xyz.com',
          cache: false,
          success: function(data){}
        );
  </code></pre>
  
  <p>If the request fails(server not responds), how do i redirect to another domain.</p>
  
  <p>I did the same thing by using jquery getJson in the follwing way:</p>
  
  <pre><code>$.getJSON('xyz.com',function(result) {})
   .error(
      function(xhr, textStatus, errorThrown){
          if (xhr.status == 500) {
              $.getJSON('zxy.com', function(result){});
          }
      });
  });
  </code></pre>