Open window in different styles : open « Window « JavaScript Tutorial






<html>
<head>
<title>Open Window</title>
<script language="JavaScript" type =" text/javascript">
<!--
function ChangeLink(currentform)
{
    var window_feature = "";
    alert(window_feature);

    for (var cb=0; cb<currentform.length - 1; cb++) {
        if (currentform[cb].checked)
        {
             currentform[cb].value = 1;
        } else {
             currentform[cb].value = 0;
        }
        window_feature = (window_feature + "," + currentform[cb].name + "= [ic:ccc]"+ currentform[cb].value);
    }

    window.open("http://www.java2s.com", "_blank", window_feature);

}
//-->
</script>
</head>
<body>
<form name="form1">
  <input type="checkbox" name="directories" value="0">Directories Option</p>
  <P><input type="checkbox" name="location" value="0">Location Option</p>
  <P><input type="checkbox" name="menubar" value="0">Menu Bar</p>
  <P><input type="checkbox" name="resized" value="0">Allow Window to be Resized</p>
  <P><input type="checkbox" name="scrollbars" value="0">Scrollbars</p>
  <P><input type="checkbox" name="status" value="0">Status Bar</p>
  <P><input type="checkbox" name="toolbar" value="0">Toolbar</p>
  <P><input type="button" value="Create Window" name="CreateWin" onClick="ChangeLink(this.form)"></p>
</form>
</body>
</html>








19.12.open
19.12.1.Open new window
19.12.2.Popup window with window.open
19.12.3.Open new window with 'toolbar=no, status=no, width=200,height=200'
19.12.4.Open new window with '_blank' setting
19.12.5.Open window in different styles
19.12.6.This example pops up a new window and then writes a string to it
19.12.7.Using document.write() on the Current Window
19.12.8.Using document.write() on Another Window