i have code that sets
window.location.href = [someurl]
but i want to have it open up in a new tab. Is there anyway to have the above code include
target="_blank"
from javascript?
Yes
window.open([someurl], "_blank");
or since _blank is the default
window.open([someurl]);
Use window.open()
https://developer.mozilla.org/en/DOM/window.open
window.location.href just changes the location of the current window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With