example on window object method in javascript

window object methods

Posted on

<html>

<head><title></title>

<script type=”text/javascript”>

var mywindow

function openCenteredWindow(url)

{

var mywindow

mywindow=window.open(url,”subwind”,400,400,status.resizable);

}

function show_alert()

{

alert(“Hi!!!! I am alert box”)

}

function resizeWindow()

{

window.resizeBy(-100,-100);

}

function closeWindow()

{

if(window.confirm(“do you want to close the browser”))

window.close();

}

</script>

</head>

<body>

<input type=”button” value=”Open a New Window” onClick=”openCenteredWindow(‘WindowsMethods.html’)”/>

<input type=”button” value=”alert” onClick=”show_alert()”/>

<input type=”button” onClick=”resizeWindow()” value=”Resize window”>

<input type=”button” onClick=”closeWindow()” value=”close the window”>

</body>

</html>

1

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com