I am making an ajax request to a server in another domain
You cannot make an ajax request in another domain due to policies of the same origin . You want to look at JSONP, which essentially writes out the <script> for the remote URL.
What is JSONP?
Finding success / error using JSONP calls is difficult, it doesn’t work at all like regular ajax calls. Ideally, you want the remote server to call the callback function on your page as described above.
If you do not control another domain, you can try to detect errors by timeout. Here is a post discussing the jQuery timeout argument for this, although you can certainly implement your own timeout with raw javascript as well.
source share