PDA

View Full Version : Help with pop-up..



Amyism
12-31-2006, 07:08 PM
Does anyone know a code which closes a certain pop-up of a visitor when they enter your site?

jscheuer1
12-31-2006, 08:52 PM
Well, you say 'certain popup'. Which popup is it? Where did it come from? Was it opened with javascript and is it represented by a variable name accessible to the page that you want to have close it?

If the answer is yes:


var_name.close();

Amyism
01-01-2007, 11:08 AM
No, it wasn't opened my javascript. Just a pop-up that the visitor already has opened when they visit the site.

jscheuer1
01-01-2007, 11:19 AM
I guess it isn't really a 'certain pop-up' then, is it?. It might not have to have been opened by your script, just some script and, your page would need a way to access the pop up. This is unlikely to be possible but, might be. The more specifics that are certain about the pop up, the more likely it would be that a method of closing it could be found. If it is just any old pop up that the user just happens to have open from some other site that they were on, the best that you could do would be to entice the user into opening a pop up on your page and hope that their browser was set to reuse windows for that sort of thing. Once the pop up window is populated with your content, you may be able to close it, or at least prompt the user to do so.

Amyism
01-01-2007, 11:51 AM
Is there any special code for this?
I know the url for the pop-up.. if that helps.

jscheuer1
01-01-2007, 07:39 PM
Is there any special code for this?
I know the url for the pop-up.. if that helps.

Not too much.

I already gave you the code, even more basically it is:


window.close();

The trick is to find a way to grab window and close it that doesn't violate any of the various security restrictions that probably apply to this type of cross domain scripting.

As I say, this might not be possible. The only way to figure out if it can be done would be to play with the actual conditions that exist at the time that this undesirable pop-up is there and your sight is just loading.

Can you provide a link and instructions as to how to proceed to your site from that link in such a way as the undesirable pop up exists as one enters your site?