How to open a link on the same window using window.open or any other method in JavaScript.
You just set window.location equal to a URL string.
If you really wanted to use window.open, you set the window’s name to “_self”:
window.open('http://www.newpage.com/', '_self');