Search This Blog

Thursday 26 May 2016

Javascript to open popup window and disable parent window

<script type="text/javascript">
 
        var modelpopupWindow = null;
 
        function childopen() {
 
            modelpopupWindow = window.open('about.html'"_blank","directories=no, 
                      status=no, menubar=no, scrollbars=yes, resizable=no,
                      width=600, height=280,top=200,left=200");
        }
        function parentdisable() {
            if (modelpopupWindow && !modelpopupWindow.closed)
                modelpopupWindow.focus();
        }
    </script>
<body onfocus="parentdisable();" onclick="parentdisable();">
    <a href="javascript:childopen()">Click me</a>
    <p>Hi user</p>   
</body>
To disabled parent window using javascript. 
Suppose you have any links please disabled those link using javascript.