close
The Wayback Machine - https://web.archive.org/web/20150317162418/https://www.hscripts.com/scripts/JavaScript/disable-parent-window.php

DISABLE PARENT WINDOW SCRIPT

This javascript function will help you to disable the focus of parent window when child popup window arises in a webpage.

Features

  • You can get the popup window functionalities and the script to disable parent window using this javascript .
  • Parent window works only when child window is closed.
  • Simple and ease of use.
  • Just copy the code in to your page and use it.

Preview

click the button to see the preview. Works only in Internet Explorer(IE)

Downloads

Javascript code
<!-- Script by hscripts.com -->
<script type="text/javascript">
function topWindow() {
var popup = window.open('simplett.html','Testing','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollb ars=no,resizable=no,width=400,height=200,left=350,top=200');
popup.focus();
}
</script>
<!-- Script by hscripts.com -->

  • Release Date - 24-12-2007
  • Get free version without ©copyright link for just $5/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy the following Java script code into your parent page.
  •  <input type="button" id="hide" onclick="topWindow()" value="click">  
  • Just include <body onblur="self.focus()"> in child window.
  • Now the Java script function will work fine.
  • Note:Use the JavaScript code with in the head tag.

License

  • The javascript (misspelled as java script) is given under GPL License.
  • i.e. Free use for those who use it as it is.
  • Free, if your modification does not remove our copyright information and links.
  • Detailed License information can be found here.
  • You can purchase the script if your requirements does not meet GPL License terms.

Related Scripts

Free Javascript Scripts