<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<rss version="0.91">
    <channel>
        <title>Power Hoster :: Article</title>
        <description><![CDATA[Article XML]]></description>
        <link>http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1</link>
        <lastBuildDate>Sun, 12 Feb 2012 12:34:52 +1800</lastBuildDate>
        <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
        <image>
            <url>http://www.powerhoster.com/domainhosting/modules/article/images/logo.png</url>
            <title>Power Hoster :: Article</title>
            <link>http://www.powerhoster.com/domainhosting/modules/article/</link>
            <width>80</width>
            <height>15</height>
            <description>Article XML</description>
        </image>
        <language>en</language>
        <managingEditor>support at powerhoster dot com</managingEditor>
        <webMaster>support at powerhoster dot com</webMaster>
        <category>Hosting Article</category>
        <item>
            <title>Detecting Popup Blockers</title>
            <link>http://www.powerhoster.com/domainhosting/modules/article/view.article.php/2325/c1</link>
            <description><![CDATA[Category: Domain Registration<br />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]<br />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. <br /><br />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. <br /><br />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. <br /><br />The key to this working is to keep track of the window handle and check if javascript can access it. <br /><br />View sample <br /><br /><script language="javascript"><br />//set object to hold windows<br />var oWindowsT = new Object();<br /><br />function openWindowCheck(pageId) {<br />//open window<br />openWin(pageId);<br /><br />//check if the window opened<br />setTimeout("checkOpen(\"" + pageId+ "\")",1000);<br />}<br /><br /><br />function checkOpen(pageId) {<br />try {<br />if ( (!oWindowsT[pageId]) || (oWindowsT[pageId].closed) ) {<br />//handle code how ever you want<br />var elem = window.document.getElementById("popupmsg");<br />elem.style.visibility = "visible";<br />} else {<br />var elem = window.document.getElementById("popupmsg");<br />elem.style.visibility = "hidden";<br />}<br />}catch(e){<br />//if unable to read var show message<br />}<br />}<br /><br />function closeIt() {<br />window.document.getElementById("popupmsg").style.visibility = "hidden";<br />}<br />//open a window<br />function openWin(pageId) { <br />switch (pageId) {<br />case "page1":<br />//set window properties<br />var sPar = "width=500,height=500";<br />handle = window.open("http://cnn.com",pageId,sPar);<br />break;<br />case "page2":<br />//add code for another id<br />//handle = window.open(sURL,page,sPar);<br />break;<br />default:<br />}<br />//add handle to window object holder<br />oWindowsT[pageId] = handle;<br />}<br /><br /></script><br /><html><br /><body onload="openWindowCheck('page1');" style="margin:0"><br /><style><br />#msg{<br />background-color:#ccffff;<br />height:200;<br />width:200;<br />font-family:verdana<br />}<br /></style><br /><div id="popupmsg" style="visibility:hidden;text-align:center;"><br /><div id="msg" style=""><br />^<br><br />^<br><br />^<br><br />^<br><br />It appears you have your popup blocker turned on for this site.<br /><br><br /><a href="(script removed)closeIt()">close</a><br /></div><br /></body><br /></html><br />]]></description>
            <author>Powerhoster</author>
            <pubDate>Thu, 01 Jan 1970 00:00:00 +1800</pubDate>
        </item>
    </channel>
</rss>

