Reputation: 81
I am trying to open a route in a new window upon a hyperlink click. target=_blank
is not of much help since I am trying to open in new window, not new tab. window.open
also opens in a new tab. Is this at all possible?
Upvotes: 2
Views: 16086
Reputation: 1431
You can use this to open a new window:
window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
If you have different urls (dev env, test env, prod env) you can use this to get the base url:
window.location.origin
So final code is:
window.open(window.location.origin + "/ROUTE_U_WANT", '_blank', 'toolbar=0,location=0,menubar=0');
Upvotes: 15