リダイレクト URL である残りの呼び出しで渡される uri があり、呼び出しをインターセプトして、ヘッダーにリダイレクトの「場所」を取得できるようにしたいと考えています。
次のコードは、Location ヘッダーに対して null を返します。このクライアント側を実行する適切な方法は何ですか?
$(document).ready(function () {
$.ajax({
url: 'http://myserver.com/redirect?token=AAAnY13Y-76LZ4zXDOd', // obviously not cross domain and contains redirect location to a youtube link to embed in my page, http://www.youtube.com/embed/bl2j345-xy
data: {
something: 'someotherthing'
},
complete: function (request, status) {
var location = request.getResponseHeader("Location"); // this is null...it shows up in Fiddler as http://www.myotherserver.com in the Location Header
},
error: function (request, error) {
alert(request.responseText);
}
});
});