|
|
Java menu script>Menu Make>Age
Redirection
|
Occassionally, your web site might need to redirect
minors away from adult content. This script is a VERY simple preliminary age check. Those
underage are then forwarded to www.crayola.com. |
|
|
The JavaScript Source: Navigation: Age Redirection
Simply click inside the window below, use your cursor to highlight the script, and copy
(type Control-c or Apple-c) the script into a new file in your text editor (such as
NotePad or SimpleText) and save (Control-s or Apple-s). The script is yours!
|
<!-- TWO STEPS TO INSTALL AGE REDIRECTION:
1. Paste the coding into the HEAD of your HTML document
2. Copy the onLoad event handler into the BODY tag -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function getName() {
var name1 = prompt("What is your name?", "")
var age = prompt("How old are you?", "")
var email1 = prompt("What's your e-mail address?", "")
if( age <= 12) {
alert("Hey kid... You're only " + age + " and expect to stay here!! No way!
" + name1 + ", get out of here! If you are at " + email1 + " , then I
have your e-mail too!!")
window.open("http://www.crayola.com")
} else {
alert("Hello " + name1 + "! Welcome to The JavaScript Source! Since you are
" + age + ", you are allowed to stay!! If your e-mail is " + email1 +
", you can expect some e-mail soon....")
}
}
// End -->
</SCRIPT>
<!-- STEP TWO: Add this onLoad event handler into the BODY tag -->
<BODY onLoad="getName()">
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts
provided<br>
by <a href="http://javascriptsource.com">The JavaScript
Source</a></font>
</center><p>
<!-- Script Size: 0.56 KB -->
|
|
|
|