Wednesday, November 2, 2011

Opening a New Window With JavaScript

Use Window open() Method.
The open() method opens a new browser window.



Optional. Specifies the URL of the page to open. If no URL is specified, a new window with about:blank is opened
Optional. Specifies the target attribute or the name of the window. The following values are supported:

  • _blank - URL is loaded into a new window. This is default
  • _parent - URL is loaded into the parent frame
  • _self - URL replaces the current page
  • _top - URL replaces any framesets that may be loaded
  • name - The name of the window ‘
<script type="text/javascript">
function open_win()
<input type=button value="Open Window" onclick="open_win()" />

No comments :

Post a Comment