detect popup blocker

I need a way to detect if the user is useing a popup blocker, and if so alert them to turn it off.  i dont know which way would be better to open a test windows and then somehow check if its open or if there is any other way..?
LVL 2
mattaustinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

devicCommented:
hi mattaustin,

like this :)
=================
<script language = JScript.Encode>#@~^6wAAAA==@#@&\CMPaWw!w,xPSkUNKh ^Kx0b.:vBfK~zW!P4l-+~C,wGw!2P(VG^0+D_w      Zsk1V,rF,k6PXKE,4l7+~r"P/C      m+^~k6PxKOv#p@#@&kW`Z2Kw;w*Ak      NGAcmWUWbDh`EWMlU0VHgB*@#@&r0vwGw!wbC^+DDcBkYDmrLtDPslU"vb@#@&nVknPmVn.D`BCUHhCX,r,NG      Y'BP(+^r\PzW!~~^4+lDnDeB#@#@&iUsAAA==^#~@</script>
0
devicCommented:
oops sorry for mistake:
==============
<script language = JScript.Encode>#@~^8QAAAA==@#@&\CMPaWw!w,xPSkUNKh ^Kx0b.:vBfK~zW!P4l-+~C,wGw!2P(VG^0+D_w      Zsk1V,rF,k6PXKE,4l7+~r"P/C      m+^~k6PxKOv#p@#@&kW`Z2Kw;w*`hbx[GSRmGU6k.:vv6DC      3^XgE#)@#@&b0cwKw;2*      l^nDD`BkO.lbo4Y~:CUeBb8@#@&+^/n~PlVn.D`vl      zSlz,k,NW      Y'vP(+sk7+~zKE~,^tlY.ZB*8@#@&cU4AAA==^#~@</script>
0
devicCommented:
monday ;(
this what i mean :)
=========================
<script>
var popup = window.confirm('Do you have a popup blocker?\nClick OK if you have OR Cancel if not');
if(!popup){window.confirm('frankly?')}
if(popup){alert('straight man!')}
else {alert('anyway i dont\' belive you!')}
</script>
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jaysolomonCommented:
var nw = window.open("somewhere.asp","newWin");
if(!nw){
  alert("Please turn off that pop up blocker so i can show you something");
}


Maybe this wil work
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BustaroomsCommented:
jay,  i currently use something similar to your version

i put this at the beginning of my page

//open the test popup window for popup blocking detection
 var mine = window.open('','','width=1,height=1,scrollbars=no');
 if(mine)
    var popUpsBlocked = false
 else
    var popUpsBlocked = true
 mine.close()

then later on on my page
if(popUpsBlocked)
  alert('We have detected that you are using popup blocking software.\nIn order to access...');




end users of my pages would email my company all the time and half the time our response would be "You will need to turn off your.....".    I have implemented this on certain pages and have not had any of those emails from end users using those pages....so its going good so far
0
BustaroomsCommented:
just to let you know that it does work
0
jaysolomonCommented:
Thats good Busta.

I haven't really thought much about the pop up blockers.

Nice script, keep your good code a coming ;)



@devic
Why use IE only stuff?
0
devicCommented:
@ jaysolomon,
what do you mean?
0
jaysolomonCommented:
>>JScript.Encode

IE only
0
mattaustinAuthor Commented:
i guess i accepted the answer a little early , it dosn't seem to sop the google toolbar popup blocker...?
0
BustaroomsCommented:
do you have this posted somewhere?  could you provide a url
0
devicCommented:


@jaysolomon
ok this was just a joke. :)

@mattaustin,

google toolbar popup blocker is smart. And blocks only unrequested popups.
Use popup with user event, and the popup comes.
0
jaysolomonCommented:
I no nuffin about the google popup blocker, maybe busta or devic do.
0
BustaroomsCommented:
meaning, if you have a link that opens a popup, Google will let it through for example
<a href="#" onclick="window.open('http://www.google.com','googleWin');return false;">Open Google</a>

but if you try

<body onload="window.open('http://www.google.com','googleWin');">

Google will swat that ish
0
mattaustinAuthor Commented:
devic-  

how do i Use popup with user event ?


http://www.mycoolphone.com/popuptest.html
0
devicCommented:
if for example user clicks the link or button <input type=button onclick=mypopup()>
0
devicCommented:
mattaustin,

here is my example, how to check if exists a window.


============================================
<html>
<head>
    <title>Untitled</title>
<script>
//created by devic
//super puper popup tester
function popUp(url, myname, w, h, scroll) {
     var winl = (screen.width - w) / 2;
var wint = ((screen.height - h) / 2)-20;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=0, status=0, resizable=0,menubar=0'
eval(myname+" = window.open(url, myname, winprops)");
if (parseInt(navigator.appVersion) >= 4) { eval(myname+".window.focus()"); }
}

function checkWindow(namez)
{
      try{
            if(eval("window."+namez+".document"))
            {
                  alert("Window \""+namez+"\" open");
            }
            else
            {
                  alert("Window \""+namez+"\" not found");
            }
      }
      catch(e)
      {
            alert("Window \""+namez+"\" not found");
      }
}
</script>
   
</head>

<body>

<a href="somePage.htm" onClick="popUp('','test1','295','300','no');return false;">Test1</a>
<br />
<a href="somePage.htm" onClick="popUp('','test2','295','300','no');return false;">Test2</a>
<p />
<input type="submit" value="test window test1" onClick="checkWindow('test1');" />
<input type="submit" value="test window test2" onClick="checkWindow('test2');" />
</form>
</body>
</html>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.