Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Popup window - controlled position


< html >
< head >
< script >
function win() {
msg = window.open( "" , "msg" , "height=200,width=200,left=80,top=80" );
msg.document.write( "<html><title>Windows!</title>" );
msg.document.write( "<body bgcolor='white' onblur=window.close()>" );
msg.document.write( "<center>page content here</center>" );
msg.document.write( "</body></html><p>" );

// If you just want to open an existing HTML page in the
// new window, you can replace win()'s coding above with:
// window.open("page.html","","height=200,width=200,left=80,top=80");

}
</ script >

</ head >
< body >
< body bgcolor = "white" >

< form >
< input type = "button" value = "Open Window" onclick = "win()" >
</ form >

< a href = "javascript:win()" > Open Window </ a >

</ center >
</ BODY >
</ html >