Monday, 25 February 2013

The following example opens an about:blank page in a new browser window:

Ex:1


<!DOCTYPE html>
<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>This is 'myWindow'</p>");
myWindow.focus();
}
</script>
</head>
<body>

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

</body>
</html>



Ex:2

<!DOCTYPE html>
<html>
<head>
<script>
function open_win()
{
window.open("http://www.mkiranu.blogspot.in","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
}
</script>
</head>

<body>
<form>
<input type="button" value="Open Window" onclick="open_win()">
</form>
</body>

</html>



No comments:

Post a Comment