CodeIgniter Forums
How can i open popup window from controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How can i open popup window from controller (/showthread.php?tid=18173)

Pages: 1 2


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]jdfwarrior[/eluser]
I wonder if he's got the point that popups are bad yet? lol


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]Dam1an[/eluser]
[quote author="jdfwarrior" date="1240948120"]I wonder if he's got the point that popups are bad yet? lol[/quote]

Not quite, a few more popup rants should do it
I wonder if he's been getting a lot of those "Congratulations, you've won £1000000" popups, and therefore loves them


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]slowgary[/eluser]
Actually, I might have been mistaken. If the popup occurs on behalf of a click event, I think the browser lets it pass. It's basically nothing more than target='_blank'


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]Dam1an[/eluser]
Not true... by default, firefox blocks popups on Google Reader, but middle clicking on a link, still gives me the notice that a popup was blocked


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]TheFuzzy0ne[/eluser]
[quote author="slowgary" date="1240949141"]Actually, I might have been mistaken. If the popup occurs on behalf of a click event, I think the browser lets it pass. It's basically nothing more than target='_blank'[/quote]

I don't know, but even with Firefox's popup blocker enabled, I keep getting popups from certain sites regardless, even though they aren't allowed to.


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]Dam1an[/eluser]
[quote author="TheFuzzy0ne" date="1240950098"][quote author="slowgary" date="1240949141"]Actually, I might have been mistaken. If the popup occurs on behalf of a click event, I think the browser lets it pass. It's basically nothing more than target='_blank'[/quote]

I don't know, but even with Firefox's popup blocker enabled, I keep getting popups from certain sites regardless, even though they aren't allowed to.[/quote]

Popups or popunders? Cause popunders do something sneaky, and can get past a lot of popup blockers :S


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]jdfwarrior[/eluser]
[quote author="Dam1an" date="1240950359"][quote author="TheFuzzy0ne" date="1240950098"][quote author="slowgary" date="1240949141"]Actually, I might have been mistaken. If the popup occurs on behalf of a click event, I think the browser lets it pass. It's basically nothing more than target='_blank'[/quote]

I don't know, but even with Firefox's popup blocker enabled, I keep getting popups from certain sites regardless, even though they aren't allowed to.[/quote]

Popups or popunders? Cause popunders do something sneaky, and can get past a lot of popup blockers :S[/quote]

Popunders just use poprocks and liquid to bypass the popup blocker, nothing that special


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]Dam1an[/eluser]
If they're nothing special, why does even the latest version of Firefox (and IE/Opera) still get caught out by them?


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]jdfwarrior[/eluser]
[quote author="Dam1an" date="1240950940"]If they're nothing special, why does even the latest version of Firefox (and IE/Opera) still get caught out by them?[/quote]

I feel as if we might have taken this a little too far haha


How can i open popup window from controller - El Forum - 04-28-2009

[eluser]slowgary[/eluser]
Because they're PURE candy! I don't think popunders are any different than popups, I believe that the parent window just calls a window.focus() or something. I too have noticed a few sites that seem to get by popup blockers, IMDB for one. But this is a different topic.

So for the original poster, if you're just trying to make a link open in a new window you can use the target attribute, like this:
Code:
<a href='page.html' target='_blank'>click here</a>

This will not validate as XHTML strict (and probably other doctypes as well) because it's not a valid attribute (it may have been deprecated or proprietary all along, I'm not sure). It's also not considered very good practice as you should allow your user to decide which links to open in a new tab/window. Not only are many users annoyed by links breaking out of the window, some users are confused by it as it kills the browser's back button.

If your intentions are to redirect a user, and have the new page open in a new window, it won't really work. You can use javascript and call the window.open(url, window name, options) method.