Reputation: 21
How do I decide whether to open my local web page window with window.open
or window.location.href
?
Upvotes: 2
Views: 1789
Reputation: 21
if window.opener == null
// open by window.location.href
else
// open by window.open
Upvotes: 0
Reputation: 302
Simply,
window.open()
will open a new window for your passing URL in side the parentheses.
window.location.href
will redirect you to the passing URL with in the same window.
Upvotes: 1