Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 447 |  Welcome, Guest!   Register  Login
 Home > Coding Horrors > JavaScript > how to check internetexplorer popup block is enabled or not? ...
Hariinakoti

how to check internetexplorer popup block is enabled or not?

 Coding Horror posted by: Hariinakoti | Posted on: 9/21/2012 | Category: JavaScript | Views: 1462 | Level: Starter | Status: [Member] | Points: 75 | Alert Moderator   



Hi Friends,
             as for my requirement i want to check internet explorer popup blocker is enabled or not?i wrote code like this in javascript.This code taken only else part.Because in that variable taken only object.Please solve my problem.Please see my code.

<head id="Head1" runat="server">
    <title>Untitled Page</title>
<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>



Thanks & Regards
Hari
Found interesting? Add this to:


About Hari Inakoti

Experience:0 year(s)
Home page:www.dotnetfunda.com
Member since:Tuesday, April 03, 2012
Level:Starter
Status: [Member]
Biography:
 Responses
Johndoe
Posted by: Johndoe | Posted on: 11/28/2012 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

good post

keep up the good work

>> Write Response - Respond to this post and get points

More Coding Horrors

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 3:31:09 PM