<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en">
    <title>Power Hoster :: Article</title>
    <tagline>Article XML</tagline>
    <link rel="alternate" type="text/html" href="http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1"/>
    <id>http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1</id>
    <modified>2010-07-31T01:14:55+18:00</modified>
    <author>
        <name>support at powerhoster dot com</name>
    </author>
    <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
    <entry>
        <title>Detecting Popup Blockers</title>
        <link rel="alternate" type="text/html" href="http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1"/>
        <created>1970-01-01T00:00:00+18:00</created>
        <issued>1970-01-01T00:00:00+18:00</issued>
        <modified>1970-01-01T00:00:00+18:00</modified>
        <id>http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1</id>
        <author>
            <name>Powerhoster</name>
        </author>
        <summary>Category: Domain Registration&lt;br /&gt;Summary: With all the new spyware and unsolicited advertisement users are becoming more aware of the problems they can cause on their PC. Many users have installed popup blockers by downloading a free one form the internet or updating to service pack 2. These blockers have been great at eliminating most of the annoying things that come along with the popups.Detecting Popup Blockers [2/16/2005, Geo Hilal]&lt;br /&gt;With all the new spyware and unsolicited advertisement users are becoming more aware of the problems they can cause on their PC. Many users have installed popup blockers by downloading a free one form the internet or updating to service pack 2. These blockers have been great at eliminating most of the annoying things that come along with the popups. &lt;br /&gt;&lt;br /&gt;Unfortunately there is still a legitimate need to have windows popup. A user may experience a site as broken because their blocker did not allow a valid window to open. One way to do this is to check if javascript can access the handle to the window that was opened. &lt;br /&gt;&lt;br /&gt;I have tested this technique with these popup blockers, IE (SP 2), FireFox, Yahoo, and Google and it seems to work. Below is the sample code. &lt;br /&gt;&lt;br /&gt;The key to this working is to keep track of the window handle and check if javascript can access it. &lt;br /&gt;&lt;br /&gt;View sample &lt;br /&gt;&lt;br /&gt;&lt;script language=&quot;javascript&quot;&gt;&lt;br /&gt;//set object to hold windows&lt;br /&gt;var oWindowsT = new Object();&lt;br /&gt;&lt;br /&gt;function openWindowCheck(pageId) {&lt;br /&gt;//open window&lt;br /&gt;openWin(pageId);&lt;br /&gt;&lt;br /&gt;//check if the window opened&lt;br /&gt;setTimeout(&quot;checkOpen(\&quot;&quot; + pageId+ &quot;\&quot;)&quot;,1000);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function checkOpen(pageId) {&lt;br /&gt;try {&lt;br /&gt;if ( (!oWindowsT[pageId]) || (oWindowsT[pageId].closed) ) {&lt;br /&gt;//handle code how ever you want&lt;br /&gt;var elem = window.document.getElementById(&quot;popupmsg&quot;);&lt;br /&gt;elem.style.visibility = &quot;visible&quot;;&lt;br /&gt;} else {&lt;br /&gt;var elem = window.document.getElementById(&quot;popupmsg&quot;);&lt;br /&gt;elem.style.visibility = &quot;hidden&quot;;&lt;br /&gt;}&lt;br /&gt;}catch(e){&lt;br /&gt;//if unable to read var show message&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function closeIt() {&lt;br /&gt;window.document.getElementById(&quot;popupmsg&quot;).style.visibility = &quot;hidden&quot;;&lt;br /&gt;}&lt;br /&gt;//open a window&lt;br /&gt;function openWin(pageId) { &lt;br /&gt;switch (pageId) {&lt;br /&gt;case &quot;page1&quot;:&lt;br /&gt;//set window properties&lt;br /&gt;var sPar = &quot;width=500,height=500&quot;;&lt;br /&gt;handle = window.open(&quot;http://cnn.com&quot;,pageId,sPar);&lt;br /&gt;break;&lt;br /&gt;case &quot;page2&quot;:&lt;br /&gt;//add code for another id&lt;br /&gt;//handle = window.open(sURL,page,sPar);&lt;br /&gt;break;&lt;br /&gt;default:&lt;br /&gt;}&lt;br /&gt;//add handle to window object holder&lt;br /&gt;oWindowsT[pageId] = handle;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;body onload=&quot;openWindowCheck('page1');&quot; style=&quot;margin:0&quot;&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;#msg{&lt;br /&gt;background-color:#ccffff;&lt;br /&gt;height:200;&lt;br /&gt;width:200;&lt;br /&gt;font-family:verdana&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;div id=&quot;popupmsg&quot; style=&quot;visibility:hidden;text-align:center;&quot;&gt;&lt;br /&gt;&lt;div id=&quot;msg&quot; style=&quot;&quot;&gt;&lt;br /&gt;^&lt;br&gt;&lt;br /&gt;^&lt;br&gt;&lt;br /&gt;^&lt;br&gt;&lt;br /&gt;^&lt;br&gt;&lt;br /&gt;It appears you have your popup blocker turned on for this site.&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;a href=&quot;(script removed)closeIt()&quot;&gt;close&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;</summary>
    </entry>
</feed>
