pop-blocker detection w/ cookie detection

admin

Administrator
Staff member
hello :)

i'm trying to determine whether a user has a pop-up blocker enablem and whether cookie are disabled all in teh same script. I use ASP to only set the cookie. i'm all confused. i would like to say:

if blocker enabled and cookie disabled then
alert = "disable pop-blocker and enable cookies"
else
if no blocker and cookie disabled then
alert="enable cookies"
else
if blocker enabled and cookie enabled then
alert"disable blocker"
else
if blocker disable and cookie enable then
kill cookie and pop-win self.close

this is what i have so far:

in the main.htm

<%
Response.Cookies("b12a")="1"
%>

<head>
<script>
function checkPop(){
window.open("check.htm","")
}
</script>
</head>
<body onLoad="checkPop()">
<form name="popResult">
<input name="warning" value=http://www.webdeveloper.com/forum/archive/index.php/"Please Turn Off Pop-up blocker">
</form>
</body>


in the pop.htm

<head>
<script>
window.opener.popResult.warning.value="No Pop-Up Killer Detected"
if (document.cookie){
self.close
}
else{
alert="cookies must be enabled"
}
else{
exp = new Date();
exp.setTime(exp.getTime() - (24*60*60*1000));
var cval = getCookie(b12a);
cval = (cval == null) ? "" : cval;
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
self.close()
}
</script>
</head>
 
Back
Top