I'm trying to redirect from www.domain1.com to www.domain2.com getting the actual domain name.
Let's say that our page is www.domain1.com:
var domainName = window.location.host;
var domainNumber = domainName.substr(10, 1);
var finalDomain = (domainNumber+1);
If I print finalDomain
on the screen, I got 11. So because of that my redirect is not working.
How do I do domainNumber
plus 1, so I got 2 and not 11?