jQuery ajax - Absolute URL's and error handling
<p>Is it possible to catch the HTTP errors (like 404, 500, 504 etc) when we call an external webservice by specifying an absolute url?. (like setting the <code>url:</code> attribute of <code>$.ajax</code> call to have a url value as <code>http://api.geonames.org/findNearbyPostalCodes</code>.</p>

<p>Right now I'm unable to receive any errors although firebug is catching them and showing it in the console.</p>

<p>Can someone help?</p>

<p>Here is my code.</p>

<pre><code>$.ajax({
    type: 'GET',
    url: "http://api.geonames.org/findNearbyPostalCodes",
    data: '{"lat":47,"lng":"9","username":"demo"}',
    dataType: 'json',
    cache:false,
    async:false,
    statusCode:{
        404: function(){
            alert('Page not found');
        },
        500: function(){
            alert('Page not found');
        },
        504: function(){
            alert('Unknown host');
        }
    },
    success: function(data){
    alert(data);
         }
              error: function (xhr, exception, thrownError)
              {
                  alert(xhr.status);
              }
});
</code></pre>
