Forum Moderators: open

Message Too Old, No Replies

When I open a pop up can i also close the parent window?

how to close a Window

         

sebbyp

1:55 pm on Feb 24, 2005 (gmt 0)



I basically start in a site and i need once poped up to close the window at the same time..

Login ----> Window 1 ----> Link to PopUp Window

Once clicked popup window ----> I want it to.

Close the window aswell so all u r left wit is da popup.
Im sure it is possible.

ThankYou Sebastien Payet

SpaceFrog

2:21 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



why couldn't you juste show new link in same window? and open false popup with hidden div that becomes visible ...

Otherwise it is possibe but only under IE, it wousl not be multibrowser ...

rocknbil

2:20 am on Feb 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will most likely get an Access Denied error.

You can't close a window unless something on your page opened it, this is a security feature of Javascript. Why?

Advertiser A has his ads displaying in pop-ups on a site. (Imagine that. :-) ) He doesn't want any of his competitor ads to display. In fact, he doesn't care about the site his ad is pushing, all he cares about is selling his dirty widgets. So when his ad opens, he wants to close any window but his own. You could see how the action you are talking about would immediately be abused.

The same is true of scripts that try to diddle with content in other frames, if it didn't come from "here," you're not going to be able to do anything with it "there."