0

I am working on Application which should redirect any new window or pop ups in same current window. ie go to http://www.pageresource.com/jscript/jwinopen.htm and press "New window" button a new window pops up,I do not want this to happen ie new window should not be opened,It should open in same window i click the element.

So in total irrespective of any JavaScript written in n site i want the pop ups and new window redirect to _self

Can anyone give me a java script which will do this?

Asha
  • 10,219
  • 6
  • 39
  • 65
  • 1
    Not likely. You want to override any target set by any external website? Good luck with that :) - If you know the name of the window it is targetting, you could set your own window name when loading the external site. Any other idea would likely involve running through a proxy... – mplungjan Jan 17 '11 at 07:29
  • yes targeting external websites :) – Asha Jan 17 '11 at 08:37

1 Answers1

1

You can redirect your current site using window.location

window.location="http://www.w3schools.com"

This wont behave as a pop up, but will send your page to location you provide. If you want a pop up behaviour then, use the script as mentioned in your link and close the current window using window.close(); , which I guess will serve your purpose.

Also refer this might help you.

Community
  • 1
  • 1
niksvp
  • 5,425
  • 2
  • 22
  • 40