...

View Full Version : Javascript popup blocker workaround?



JayStang
11-07-2006, 01:52 AM
Hey Guys,
I'm trying to make a popup. Let me rephrase, not the type of popup that we all have cursed upon! But the same concept. I have a "control panel" type web application that i have developed. It is all completely dynamic. Each application has its own index.php file. My problem is, one of my applications i need has to open in a new window since its an external site. My problem is the way i have it setup dynamically in php i MUST have that inital index.php file. So what i have tried is to put in that index file just some javascript that opens a new window. Of course both IE and FF's popup blocker kick in. I need to find away around this. Does anyone have any ideas? So far i'd tried a window.open.... also tried creating a link with a target and id and then using click(); to deploy it. And i even tried creating a fake form with a target and an id and submiting it with javascript. Everything gets blocked.

Thanks in advance,
Jamie

rubenbuhr
11-07-2006, 03:06 AM
Quick thought, a 1x1 iframe?

JayStang
11-07-2006, 03:22 AM
i'm not sure if i understand... how would i make it open a new window with an iframe?

Philip M
11-07-2006, 07:32 AM
So what i have tried is to put in that index file just some javascript that opens a new window. Of course both IE and FF's popup blocker kick in. I need to find away around this. Does anyone have any ideas? So far i'd tried a window.open.... also tried creating a link with a target and id and then using click(); to deploy it. And i even tried creating a fake form with a target and an id and submiting it with javascript. Everything gets blocked.

Thanks in advance,
Jamie

Forget it. Pop-up blockers are designed to stop exactly what you are trying to do. If they could be circumvented every spammer in the universe would have done it already.

ess
11-07-2006, 10:02 AM
Hi JayStang,

Personally, I agree with rubenbuhr. I think it is the best and easiest solution to this problem.

To learn more about IFrames, you should google search IFrames and how to implement one. I found this website (http://www.samisite.com/test-csb2nf/id43.htm)which give a quick overview of IFrames are used within a page.

I could think of other solutions to this problem. Such as using Ajax to populate contents needed from the other server. (I know, there is a security thing which does not allow you to connect to another server...but I have a work around for that). But they all rely on JavaScript and I think you should stick to using an IFrame.

JayStang
11-07-2006, 12:50 PM
hi ess, thank you for the responce. I know what an iframe is and i've used them a good bit. I just don't understand how that will help me open a new window?

_Aerospace_Eng_
11-08-2006, 02:02 AM
Check this out
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow.htm

JayStang
11-08-2006, 02:41 AM
Check this out
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow.htm

wow... not quite how i want it but thats pretty damn cool!... thanks Areospace!

Philip M
08-14-2009, 04:23 PM
There is a way to do it, read on (http://website-engineering.blogspot.com/2009/08/parse-pop-up-blocker.html)

Oh dear! You have not read what Stephen Chapman says:-

"I can't guarantee that your popup will appear if you code it this way. All I can guarantee is that your popup will have a better chance of making it past the blockers if coded like this as it makes it more obvious to the popup blockers that the popup window has actually been requested by the person viewing the page and is not being generated automatically."

This does not enable unrequested or automatic pop-ups to get through. It merely helps if the pop-up has actually been requested and the browser does not recognise this.

riteshms
08-14-2009, 06:05 PM
true !
But I have tested on IE6, Firefox 3.5, chrome, Opera.
It seems fine.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum