Loading ...

Open a New Window in JavaScript | CodeAsp.Net

Open a New Window in JavaScript

0 (0votes)

In this blog I will explain how to open a new window in JavaScript.



<script type="text/javascript">

function openWin() 
	window.open("http://www.google.co.in/", "newWin", "status,width=500,height=500,top=300,left=300");



<input type="button" value="Open window" onclick="openWin()">



window.open() takes three parameters:-

  1. the URL of the file to be opened. If you do not give the URL of a file, you can used double quotes, "", which will open a blank window.
  2. the name of window.
  3. the attributes to be used in the new window.(we can use width, height, toolbar, location, scrollbars, status, etc attributes)


Mohit Kumar

Comments (no comments yet)

Top Posts