Total members 10262 | Gratitudes |It is currently Wed May 23, 2012 8:26 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: open/close new window using javascript
PostPosted: Thu Sep 15, 2011 10:40 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

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>
 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 Code to open multiple links.
 JavaScript fade out problem
 Plz Help,I want BOTH THREAD to work at a time in SAME WINDOW
 javascript read file
 getting gst, pst total to diplay in my javascript form
 java code to open word doc attached in ms access.db
 need help with javascript
 Javascript select menu validation issue
 Follow window background color
 validate age entered as selection box in javascript

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: Google Adsense [Bot] and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team