window.open(\"index.php\");
does not open the new page in the same tab, it opens it in a new tab.
I tried window.open(\"index.php\",
As far as I know, window.location
doesn't do this. The right method to do this is:
document.location = 'url-you-want-to-open.ext';
Best thing is to either include the full path (if it's on a different domain) or the absolute path if it's on the same domain. Only use relative path if the destination document is in the same folder.
To add to this:
window
= speaks to the browser and its tabs
document
= speaks to the current document that's loaded in the browser / tab.