Spectacular Free Slide Show
MP3 Sound Streamer
Email Link Encoder
Stream Website Audio
Cool Free Text Scroller
CodeLifter.com
S
oftware & S
cripts by CodeBrain.com
Home
JavaScripts
PopUp Maker
-
po
pup wind
ows
CodeLifter 5
-
source viewer
ScrollBar Styler
-
color scrol
lbars
Flash Fixer
-
rem
ove al
erts
Roll-Over Maker
-
image roll-overs
Link Cloaker 5
-
enc
rypt links
Site Capture 3
-
hidden frames
CHMOD 2 Utility
-
chmod utility
BlackBird 3.0
-
browser shell
Zoom 1.0
-
magnifier
MicroTicker.com
-
text scroller
CodeBrain.com
-
j
ava app
lets
D3Q.com
-
xp icon control
BrainCode.com
-
j
ava app
lets
MailToProtector
-
protect email
Java Applets
Perl Scripts
Affiliate Program
Index
JavaScript Ask Visitor For Name Script
Personalize Your Page
Index
( sample )
Click
here
to select the code in the window below.
Use Ctrl+C to copy it to your clipboard.
============================================================ Script: Ask Visitor For Name Script Functions: A very simple paste-it-in script that asks the vistor for his or her name when entering your page, then prints a "Hello" welcome message anywhere you wish in the body of the page. If the visitor does not type in a message, a default message shows, instead. Very easy install for JavaScript newcomers. Browsers: NS3-6, IE4-6 Author: etLux ============================================================ INSTRUCTIONS: Paste the following <script> ... </script> block into the <body> (notice we said the body, *not* the <head>) of your page, exactly where you would like the message to appear. <script> // (C) 2001 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header var whatName=prompt("Please type in your name:",""); function doName(theName){ if ((whatName != "")&&(whatName !=null)){ // you can modify this as needed // this is the message if a name is typed in document.writeln("Hello "+whatName+"!") }else{ // you can modify this as needed // this is the message if a name is *not* typed in document.writeln("Hello!") } } doName(whatName); </script> ============================================================ Design Notes: 1. When you use an in-the-body script like this, you will usually want to format the text it prints into the page. This is simple enough to do -- just surround the the <script> ... </script> block with font tags, like this:
Change the face, size, and color to match your design. 2. You may not, of course, want to use the "Hello Name!" message we show. See the two commented lines in the script above for where you can change the message. ============================================================
Get The Code!
CodeLifter is a
CodeBrain.com
Sister Site
© 1995-2008 OEC Corp & CodeLifter.com
CodeLifter™ & CodeBrain™
Legal Notices
CodeBrain InterNET Group
BrainCode.com
CodeFoot.com
CodeBelly.com
D3Q.com
etLux.com
FFFast.com
IEFix.com
PopUpWorks.com
MicroTicker.com
DavidSosnowski.com
OECCorp.com
MailToProtector.com
CodeBrain.com
Free MP3
Downloads
Contemporary classical music, completely free.
.