Total members 11895 |It is currently Thu Dec 26, 2024 5:57 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Here example show you how to open/close a new window
Code:

<html>
<
head>Open popup</head>

<
body>
<
script lanuage="JavaScript" type="text/Javascript">
 // Open new window
 function OpenWindow(){
  // setting a new window paramter
  /*
  
  - url to open 
    address of page to open in the new window.

  - window name 
  window title.
 
 
Control Attributes

 


  -width=number
   window width 

  -height=number
    window height

   -resizable=yes or no
      window is resizable (true /false)

   -scrollbars=yes or no
      enable scroll bars (true/false)

   -toolbar=yes or no
      navigation toolbar (true/false)

   -location=yes or no
      show location text filed (true/false)

   -directories=yes or no
     show extra buttons (true/false)

   -status=yes or no
     show or not the window status bar(true/false)

   -menubar=yes or no
     show menubar or not (true/false)

   -copyhistory=yes or no
    copy the navigation history from base window to new window (true/false)

  
  
  
  */
    popupWindow= window.open("close.html","Pop Up", "toolbar=no,width=400,"+
    "height=200,toolbar=yes,location=yes,directories=yes"+
    ",status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes");
    popupWindow.focus()
 }
</script>

<input type="button"   onclick="javascript:OpenWindow()"  value="open new window" />

</body>

</html>


close.html :
Code:
<FORM>
<
INPUT type="button" value="close" onClick="window.close()">
</
FORM>
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : open/close new window using javascript
 Open in a new window help     -  
 Open a link in a new window?     -  
 Google adwords open in new window     -  
 new window using javascript     -  
 First Visit Pop Up Window javascript code     -  
 Reload a Window With a Button javascript code     -  
 Close a file in php     -  
 Close database connections in php     -  
 HTTP POST msg connection close problem     -  
 Which open-source CMS is the best?     -  



Topic Tags

JavaScript Events






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com