window.open(\"index.php\"); does not open the new page in the same tab, it opens it in a new tab.
window.open(\"index.php\");
I tried window.open(\"index.php\",
window.open(\"index.php\",
The window.open function opens a new window(or tab). The window.location changes the url the current tab.
window.open
window.location