Put this in your BODY commad to triger it: onload="PrintMessage()"
////////////////////////////////////////////////////// // Script by Drew Dulgar(drewbe12@brt.bright.net) // // This is my first attempt to write aJavascript... // // Hope this comes in helpful a bit // // This script may be used and modified in anyway as long // // as this header stays in tact! // ////////////////////////////////////////////////////// ///////// words for the greeting! \\\\\\\\\\ // The Word Hi can be changed, it is just put before the persons name var before = "Hi"; // The words Welcome to my site! can be changed, it comes after the persons name var after = "Welcome to my site!"; // display the same greeting in the status bar?? // 0 = no // 1 = yes // 3 = mixture! the default is mixture... var whichone = 3 // If you selected number 3 then you can end up with this... // it will say Hi (Name), Welcome to my site -- your own words here! // If you answered 0 in the above question you need to do one more thing... // You can (optional) put your own text in the status bar, you choose! // If you want your own text in the status bar, put it in the place of "Your Text Here" below var ownwords = "Your Text Here"; // DO NOT FORGET TO EDIT THE LINE ABOVE FOR YOUR OWN TEXT IF YOU CHOOSE0 OR 3 var Pmt = prompt('Enter Your Name(just for greeting).',"undefined"); function dispname (Pmt){ document.write(""+before+" "+Pmt+" "+after+""); } // for the words to appear on the page! // for the straight forward code go to http://www.bright.net/~dwel/jscode.html function PrintMessage() { if (whichone == 1){ window.status = ""+before+" "+Pmt+" "+after+""; } if (whichone == 0){ window.status = " "+ownwords+" "; } if (whichone == 3){ window.status = ""+before+" "+Pmt+" "+after+"--"+ownwords+" "; } }