Make a new window : Window : Window Browser JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Window Browser » Window »

 

Make a new window



<html>
<head>
<title>A New Window</title>
<script language="JavaScript" type="text/javascript">
var newWindow;
function go_to_demo() {
    if (!newWindow || newWindow.closed) {
        newWindow = window.open("","sub","status,height=200,width=300");
        if (!newWindow.opener) {
            newWindow.opener = window;
        }
        setTimeout("writeToWindow()"500);
    else if (newWindow.focus) {
        newWindow.focus();
    }
}
function writeToWindow() {
    var newContent = "<html><head><title>Sub Window</title></head>";
    newContent += "<body><h1>This is a new window.</h1>";
    newContent += "</body></html>";
    newWindow.document.write(newContent);
    newWindow.document.close()// close layout stream
}
</script>
</head>
<body>
<form>
<input type="button" value="Create New Window"
 onclick="go_to_demo();">
</form>
</body>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Window Browser
» Window