Web サイトが誤ってクロスドメイン呼び出しを行っているかどうかをキャッチしようとしています (たとえば、ユーザーがドメインではなく URL に IP を入力した場合) (これは商用のインストール可能なアプリであるため、IIS を制御することはできません)。転送を設定するなど)これは機能しません:
error: function (x, e) {
// If the web service failed for any of the reasons below, then we
// call the custom error dialog display function with the response
// text passed back from the erro
if (x.status === 405) {
alert("405 error")
}
}
javascript で 405 エラーをキャッチする方法はありますか?