How to Stay on Current page while using window.open

javascript, jquery

Solution

Use _self instead of _blank.

window.open(url, "_self");

- _blank - URL is loaded into a new window. This is default

- _parent - URL is loaded into the parent frame

- _self - URL replaces the current page

- _top - URL replaces any framesets that may be loaded name - The name of the window

For further details. See This Link

Problem

I am firing the `Window.open();` command. which opens the link page in another tab. what i want is when i click the link, the link will open in new window but should be on the same page. Is that possible ? presently i am using like this. ``` function AddToDatabase(url) { window.open(url, "_blank"); } ```

Original source

Related problems