I'm trying to open a new page in a new tab.
I've tried window.open ('MyURL');
without informing a name but still it opens in a new window.
I can't replace the current tab, I need to open a new tab with a new content.
What can I do?
I'm trying to open a new page in a new tab.
I've tried window.open ('MyURL');
without informing a name but still it opens in a new window.
I can't replace the current tab, I need to open a new tab with a new content.
What can I do?
Simply do
window.location = 'MyURL';
This will replace the current page in the same window.
It looks like you're saying you want to open the new URL in a new tab, right?
Refer to these questions, which were in the related search:
Javascript: open new page in same window
Open a URL in a new tab (and not a new window) using JavaScript
Specifically,
window.open(url, '_blank');
The _blank should do it, if I understand what you're asking.