我想检测此错误
XMLHttpRequest cannot load https://accounts.example.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
例如:
$.ajax({
url: "http://api.jquery.com/jquery.ajax/"
}).done(function() {
alert( "done" );
});