Javascript Objects JavaScript DHTML



  
    var newWindow
    function openWindow() {
      var winAtts = new String()
      winAtts = "";
      if(document.winOptions.toolbarOption.checked){winAtts += "toolbar,"}
      if(document.winOptions.menubarOption.checked){winAtts += "menubar,"}
      if(document.winOptions.scrollbarsOption.checked){winAtts += "scrollbars,"}
      if(document.winOptions.resizableOption.checked){winAtts += "resizable,"}
      if(document.winOptions.statusOption.checked){winAtts += "status,"}
      if(document.winOptions.locationOption. checked){winAtts += "location,"}
      if(document.winOptions.directoriesOption.checked){winAtts += "directories,"}
      if(document.winOptions.copyHistoryOption.checked){winAtts += "copyhistory,"}
      if(document.winOptions.customSizeOption.checked){
        winAtts += "height=" + document.winOptions.heightBox.value + ",";
        winAtts += "width=" + document.winOptions.widthBox.value + ",";
      }
      winAtts = winAtts.substring(0, winAtts.length-1);
      if (document.winOptions.pageType[1].checked){
        var urlVar = ""
        urlVar = document.winOptions.urlBox.value
        newWindow = window.open(urlVar,"newWindow",winAtts)
      }else{
        newWindow = window.open("","newWindow",winAtts)
        newWindow.document.write("

Window Open Test

");
        newWindow.document.close();
      }
    }
     function closeWindow() {
       newWindow.close()
     }
  



  Existing Page
   Dynamic Page
  
   Toolbar
   Menubar
   Scrollbars
   Resizable
   Status
   Location
   Directories
   Copy History
   Custom Size
  Width:
  
  Height: