Доброй ночи.
Отправляю ajax запрос к скрипту, а у скрипта стоит переадресация на сайт (допустим example.com). Так вот, как словить, куда хочет перенаправить тебя скрипт, и не получить ошибку типа XMLHttpRequest cannot load http://telegram.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.
$.post('/redirected', {}, function(response, status, request) { if (status == STATUS.REDIRECT) { console.log(response.redirectUrl); } });