Goodnight.
I send ajax request to the script, and the script has a redirect to the site (say example.com). So, how to catch where the script wants to redirect you, and not get an error like XMLHttpRequest cannot load http://telegram.com . No 'Access-Control-Allow-Origin' header is present. Origin ' http://example.com ' is not allowed access.
$.post('/redirected', {}, function(response, status, request) { if (status == STATUS.REDIRECT) { console.log(response.redirectUrl); } });
- Alexey Shimansky