Get updated URL via JavaScript / jQuery

I want to write a JavaScript or jQuery method to send the URL name as an email request and get the changed URL [more appropriate, REDIRECTED URL].

For example, if I add a random integer to the end of facebook.com, for example http://facebook.com/940 , the URL is redirected to http://www.facebook.com/melissa.miller.967 My requirement is to get this new URL Can anyone help me in this regard

+4
source share
1 answer
$.post('/path/to/file', {url: short_url}, function(data) { window.location = data.url; }); 
0
source

Source: https://habr.com/ru/post/1484216/


All Articles