Alex Rivera | Logout

How to Stay on Current page while using window.open

Asked 2013-03-08T17:14:39.393
14

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");
}
Edit
Report

1 Answer

18

Use _self instead of _blank.

window.open(url, "_self");
  1. _blank - URL is loaded into a new window. This is default
  2. _parent - URL is loaded into the parent frame
  3. _self - URL replaces the current page
  4. _top - URL replaces any framesets that may be loaded name - The name of the window

For further details. See This Link

answered 2013-03-08T17:21:13.020

Your Answer