Click here to Skip to main content
15,914,481 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In my webpage how to check internet explorer 8 popup block is enabled or not using javascript?Please don't post url.
Please reply asap.
i'm using this code please check and modify once.

XML
<script language="javascript" type="text/javascript">
ns4=document.layers
ie8=document.all
ns6=document.getElementById&&!document.all
var xWin=null; var ticks=6;
function ChangeLabel0(txt){
if(ns4){document.layers.label0.innerHTML=txt}
if(ie8){document.all.label0.innerHTML=txt}
if(ns6){document.getElementById("label0").innerHTML=txt}
}

function StartT(){
StartPopup();
window.focus();
ChangeLabel0("<b>Popup window appears in "+ticks+" sec. Wait please...</b>");
}
function StartPopup(){
xWin=window.open("popuptest.htm","","");
alert('xWin ' +xWin);
setTimeout("test_xWin()",700);
}
function test_xWin(){
// alert("typeof(xWin)="+typeof(xWin));
// alert("typeof(xWin.location.href)="+typeof(xWin.location.href));
// alert("xWin="+xWin);
// alert("xWin.location.hash="+xWin.location.hash);
if ( (xWin==null)||(typeof(xWin)=="undefined") ||(typeof(xWin.location.hash)!="string")
// ||(xWin.location.hash!="#abc")
){sMsg="<font color=#FF0000><b>A popup killer is detected</b></font>";}
else{sMsg="<font color=#008000><b>There is NO popup killer detected</b></font>";};
//alert("xWin="+xWin+" type="+typeof(xWin)+" typeloc="+typeof(xWin.location.hash)+" hash="+xWin.location.hash);
window.focus();
ChangeLabel0(sMsg);
}
function hi()
{
alert('hi');
StartT();
return false;
}
</script>
</head>
<body onload="return hi();" >
<form id="form1" runat="server">
<div id="label0"></div>
</form>
</body>
</html>




this code is working in ie9 version and other browsers also.but i want check popup blocker in previous versions of internetexplorer.can any body help me.


Thanks & Regards
Hari
Posted
Updated 21-Sep-12 0:05am
v8
Comments
bbirajdar 17-Sep-12 9:15am    
You dont need to cehck it . IE shows a bar at the top of the browser saying that it has blocked a popup from this website.. Allow ....?

internet options-->> privacy-->> uncheck pop up blocker.....
 
Share this answer
 
Comments
Hari Krishna Prasad Inakoti 17-Sep-12 9:28am    
i want javascript code.i know this settings.as for my requirement i can identify using javascript that popup block is opened or not.
Hi,

Have you tried to search in google for this ? I found this discussion and there is answer of you question Here[^]

Hope it works for you.
 
Share this answer
 
Comments
Hari Krishna Prasad Inakoti 17-Sep-12 9:17am    
i searched already.After search only i post this question.I tried google code but it is showing message always same if i changed internet explorer popup settings also.that code is not working.
AmitGajjar 17-Sep-12 9:18am    
Have you checked given link ? check answer of abiruban.
Hari Krishna Prasad Inakoti 18-Sep-12 6:01am    
yes,i checked .but is is also not working.
AmitGajjar 18-Sep-12 9:44am    
Any error or something ? have you debug your javascript ?
bbirajdar 17-Sep-12 9:18am    
"that code is not working" is not a proper technical explanation of the problem. If somebody comes to you and says "that code is not working" , will you be able to understand his problem ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900