0

I've one problem with window.open() function.

I need to open each domain from this list and check if it's pointed to a lander.

I tried to get all domains with document.querySelectorAll... well, it doesn't matter.

When I calling function window.open(domain, '_blank') - it's always point to this url: brandnames.net/domain But I need only url to be as: google.com , not brandnames.net/google.com ( for example ).

As I understand window.open() - gives absolute path before (domain argument) - how I can to avoid this?

2
  • Or, maybe there is another function to do this? Commented Feb 17, 2019 at 8:00
  • may be domain root path settled to brandnames.net/shop by using proxy server or .htaccess file (redirect rules) that's why if you want to access brandnames.net but it is redirecting to brandnames.net/shop automatically Commented Feb 17, 2019 at 8:01

1 Answer 1

1

Try call window.open with a full protocol domain.

window.open('google.com', '_blank') // => Go to brandnames.net/google.com

window.open('https://google.com', '_blank') // => Go to https://google.com
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.