Ejemplos en Javascript

Apertura de dos ventanas

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo pr???¡ctico </TITLE>

<SCRIPT LANGUAGE="JavaScript">

 
<!----- Script copyright ????©  1997  S.Chris Brown (Spikeman)   http://www.geocities.com/BourbonStreet/3843-->
/********************************************************
**       S.Christopher Brown's (Spikeman)'s            **
**            java script bye bye window               **
**    copyright ????© 1997 S.Chris Brown (Spikeman)        **
**                spikeman@myself.com                  **
**   http://www.geocities.com/BourbonStreet/3843       **
**               All Rights Reserved                   **
**  You can freely use this script, if this credit is  **
**     included in the source. This Script is for      **
**   noncommercial use only. and has been placed in    **
**   The public domain and no fees can be charged in   **
**     conjunction with distribution or use.           **
**                  Thank you                          **
********************************************************/
// This JavaScript code Originally by S.Chris Brown  (Spikeman) 1997 ( http://www.geocities.com/BourbonStreet/3843 )    
// in the document.writeln you can write anything i happen to put image banners
// for my site in the script but you can change that to read anything.
// this goodbye window was made so when someone was leaving your site it would
// give you a "popup window" saying bye . with the setTimeout it will time
// out and close the window. i have it set to 20000 BUT you can change that
// i set it that high so the images would have time to load.
// make sure it is on UNLOAD so when it is leaving your page it will turn on
// and not before ... IF you are going to be adding some document.writeln 's
// make sure it sayz windowLeaving.document.writeln so it knows its to the
// window leaving and not the main window.
function byebyewin(){
windowLeaving=window.open("",'Leaving','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=1,width=420,height=420');
windowLeaving.document.writeln("<head><title>Goodbye!</title><body bgcolor='black' text=white>");

windowLeaving.document.writeln("<h2><center>Bye Bye</h2> ");
windowLeaving.document.writeln("<h4>Come back to my site soon</h4> ");
windowLeaving.document.writeln('<h3><center>Check out my sites</center></h3> ');
windowLeaving.document.writeln('<a href="../tppmsgs/msgs0.htm#40" tppabs="http://www.geocities.com/BourbonStreet/3843/" target=new>');
windowLeaving.document.writeln('<img src="../www.geocities.com/BourbonStreet/3843/spikeban2.gif" tppabs="http://www.geocities.com/BourbonStreet/3843/spikeban2.gif" border=1>');
windowLeaving.document.writeln('</a>');
windowLeaving.document.writeln('<a href="../tppmsgs/msgs1.htm#154" tppabs="http://www.geocities.com/BourbonStreet/9078/" target=new>');
windowLeaving.document.writeln('<img src="../www.geocities.com/BourbonStreet/9078/wildstyleimaging2.gif" tppabs="http://www.geocities.com/BourbonStreet/9078/wildstyleimaging2.gif" border=1>');
windowLeaving.document.writeln('</a>');
windowLeaving.document.writeln('<a href="../tppmsgs/msgs1.htm#155" tppabs="http://home.onestop.net/spikeman/" target=new>');
windowLeaving.document.writeln('<img src="../home.onestop.net/spikeman/antiban2.gif" tppabs="http://home.onestop.net/spikeman/antiban2.gif" border=0>');
windowLeaving.document.writeln('</a>');
windowLeaving.setTimeout("self.close()",20000);
}
//----------End Of Spikeman Bye bye Window----->

</SCRIPT>


</HEAD>

<BODY bgcolor="white" onunload="byebyewin()">


<script>
function button(){
alert("n          Spikeman's bye bye windownn                       ????© 1997 Spikeman  n                 Spikeman@myself.comnhttp://www.geocities.com/BourbonStreet/3843");byebyewin();
}
//---> </script>
<form>
<input type="button" value="THE BUTTON" OnClick="button()">
</form>


</body>
</html>

Ventanas