How do I stay in current tab when opening a new tab using javascript?
I am using this var myWindow = window.open(url, '_blank'); myWindow.focus();
But it is redirect to a new tab, I want to stay in current tab
Thanks in advance.
How do I stay in current tab when opening a new tab using javascript?
I am using this var myWindow = window.open(url, '_blank'); myWindow.focus();
But it is redirect to a new tab, I want to stay in current tab
Thanks in advance.
You can stay on same page by following ways :
window.location.replace(url);
or
window.location.href = url;