Pages: [1]   Go Down
Send this topic | Print
Author Topic: INSTALLATION GUIDE: Where Were You Born? Javascript Can Tell You!  (Read 1418 times)
»Movids«
Visual Guru
Member
*
Offline Offline

Posts: 30


WWW
« on: June 13, 2007, 08:42:05 AM »

<!-- TWO STEPS TO INSTALL WHERE BORN?:

1. Put the designated coding into the HEAD of your HTML document
2. Paste the last code into the BODY of your HTML document -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function makeArray(n) {
this.length = n
for (var i=1; i <= n; i++)
this[i] = null
return this
}
var ssn = new makeArray(57)
ssn[1] = 3
ssn[2] = 7
ssn[3] = 9
ssn[4] = 34
ssn[5] = 39
ssn[6] = 49
ssn[7] = 134
ssn[8] = 158
ssn[9] = 211
ssn[10] = 220
ssn[11] = 222
ssn[12] = 231
ssn[13] = 236
ssn[14] = 246
ssn[15] = 251
ssn[16] = 260
ssn[17] = 267
ssn[18] = 302
ssn[19] = 317
ssn[20] = 361
ssn[21] = 386
ssn[22] = 399
ssn[23] = 407
ssn[24] = 415
ssn[25] = 424
ssn[26] = 428
ssn[27] = 432
ssn[28] = 439
ssn[29] = 448
ssn[30] = 467
ssn[31] = 477
ssn[32] = 485
ssn[33] = 500
ssn[34] = 502
ssn[35] = 504
ssn[36] = 508
ssn[37] = 515
ssn[38] = 517
ssn[39] = 519
ssn[40] = 520
ssn[41] = 524
ssn[42] = 525
ssn[43] = 527
ssn[44] = 529
ssn[45] = 530
ssn[46] = 539
ssn[47] = 544
ssn[48] = 573
ssn[49] = 574
ssn[50] = 576
ssn[51] = 579
ssn[52] = 580
ssn[53] = 584
ssn[54] = 585
ssn[55] = 586
ssn[56] = 599
ssn[57] = 728
var geo = new makeArray(57)
geo[1] = "New Hampshire"
geo[2] = "Maine"
geo[3] = "Vermont"
geo[4] = "Massachusetts"
geo[5] = "Rhode Island"
geo[6] = "Connecticut"
geo[7] = "New York"
geo[8] = "New Jersey"
geo[9] = "Pennsylvania"
geo[10] = "Maryland"
geo[11] = "Delaware"
geo[12] = "Virginia"
geo[13] = "West Virginia"
geo[14] = "North Carolina"
geo[15] = "South Carolina"
geo[16] = "Georgia"
geo[17] = "Florida"
geo[18] = "Ohio"
geo[19] = "Indiana"
geo[20] = "Illinois"
geo[21] = "Michigan"
geo[22] = "Wisconsin"
geo[23] = "Kentucky"
geo[24] = "Tennessee"
geo[25] = "Alabama"
geo[26] = "Mississippi"
geo[27] = "Arkansas"
geo[28] = "Louisiana"
geo[29] = "Oklahoma"
geo[30] = "Texas"
geo[31] = "Minnesota"
geo[32] = "Iowa"
geo[33] = "Missouri"
geo[34] = "North Dakota"
geo[35] = "South Dakota"
geo[36] = "Nebraska"
geo[37] = "Kansas"
geo[38] = "Montana"
geo[39] = "Idaho"
geo[40] = "Wyoming"
geo[41] = "Colorado"
geo[42] = "New Mexico"
geo[43] = "Arizona"
geo[44] = "Utah"
geo[45] = "Nevada"
geo[46] = "Washington"
geo[47] = "Oregon"
geo[48] = "California"
geo[49] = "Alaska"
geo[50] = "Hawaii"
geo[51] = "District of Columbia"
geo[52] = "Virgin Islands"
geo[53] = "Puerto Rico"
geo[54] = "New Mexico"
geo[55] = "Guam, American Samoa, N. Mariana Isl., Philippines"
geo[56] = "Puerto Rico"
geo[57] = "Long-time or retired railroad workers"
function stripZeros(inputStr) {
var result = inputStr
while (result.substring(0,1) == "0") {
result = result.substring(1,result.length)
}
return result
}
function isEmpty(inputStr) {
if (inputStr == "" || inputStr == null) {
return true
}
return false
}
function isNumber(inputStr) {
for (var i = 0; i < inputStr.length; i++) {
var oneChar = inputStr.substring(i, i + 1)
if (oneChar < "0" || oneChar > "9") {
return false
   }
}
return true
}
function inRange(inputStr) {
num = parseInt(inputStr)
if (num < 1 || num > 586 && num < 596 || num > 599 && num < 700 || num > 728) {
return false
}
return true
}
function isValid(inputStr) {
if (isEmpty(inputStr)) {
alert("Please enter a number into the field before clicking the button.")
return false
} else {
if (!isNumber(inputStr)) {
alert("Please make sure entries are numbers only.")
return false
} else {
if (!inRange(inputStr)) {
alert("Sorry, the number you entered is not part of our database.  Try another three-digit number.")
return false
      }
   }
}
return true
}
function search(form) {
var foundMatch = false
var inputStr = stripZeros(form.entry.value)
if (isValid(inputStr)) {
inputValue = inputStr
for (var i = 1; i <= ssn.length; i++) {
if (inputValue <= ssn[i]) {
foundMatch = true
break
      }
   }
}
form.result.value = (foundMatch) ? geo[i] : ""
form.entry.focus()
form.entry.select()
}
// End -->
</SCRIPT>

<!-- STEP TWO: Paste this code into the BODY of your HTML document -->

<BODY>

Code:
<FORM METHOD=post>
Instructions:
<OL><LI>Enter the first three digits of a U.S. Social
Security number in question.</LI>
<LI>Click on the Search button.</LI>
<LI>See the corresponding state or territory in the field.</L1>
</OL>
<CENTER>
<P>Enter the first <B>three</B> digits of a Social Security number:
<INPUT TYPE="text" NAME="entry" SIZE=3>
<INPUT TYPE="button" VALUE="Search" ONCLICK="search(this.form)">
<P>
The Federal Government links this number to: 
<INPUT TYPE="text" NAME="result" SIZE=50></center>
<BR>
<HR>
<BR><BR><BR>
<P><B>For the paranoiad:</B> No information you enter here is recorded or monitored - it stays entirely within your browser.
</CENTER>
</FORM>
« Last Edit: June 22, 2007, 05:42:31 AM by Diemux » Logged


Support Movids: Add These Images In Your Sigs

Visit Movids Today
110mb Hosted - WEBSITE COMING SOON!
stereofreak69
Working on 7 Site Network
Super Authority member
******
Offline Offline

Posts: 1735

Need Help? Just PM Me! I'm Happy To Help!


WWW
« Reply #1 on: June 13, 2007, 10:22:00 AM »

Could you please post that without the code tags. Now we got a lot of deleting to do with those numbers.

Stereofreak69
Logged

Hi! I’m a signature virus! Add me to your signature


Current Projects:
     - A 8 Website Network
          1. Arcade Site
          2. Music Site
          3. Techno Site
          4. Script Site
          5. Video Streaming Site
          6. Soundboard Site
          7. Userbar Site
          8. Account Management Site

PM For More Informatio
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Offline Offline

Posts: 15639


experimental theologian


WWW
« Reply #2 on: June 13, 2007, 10:26:46 AM »

... only if you have a SSN, right?

@stereofreak69:

Just quote that post and you got it.
Logged

Hi! I’m a signature virus! Add me to your signature to help me spread.
spam me: ispamspot@gmail.com

blog | my work @ deviantART | Imagine-ng image editor
PARTHA
Check Out my Website
Member
*
Offline Offline

Posts: 24


« Reply #3 on: June 22, 2007, 05:39:51 AM »

I have used the code & its cool. So i am rewriting this code without the numbers, just for simplicity....

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->


<head>
<SCRIPT LANGUAGE="JavaScript">
   <!-- Begin
   function makeArray(n) {
   this.length = n
   for (var i=1; i <= n; i++)
   this = null
   return this
   }
   var ssn = new makeArray(57)
  ssn[1] = 3
  ssn[2] = 7
  ssn[3] = 9
  ssn[4] = 34
  ssn[5] = 39
  ssn[6] = 49
  ssn[7] = 134
  ssn[8] = 158
  ssn[9] = 211
  ssn[10] = 220
  ssn[11] = 222
  ssn[12] = 231
  ssn[13] = 236
  ssn[14] = 246
  ssn[15] = 251
  ssn[16] = 260
  ssn[17] = 267
  ssn[18] = 302
  ssn[19] = 317
  ssn[20] = 361
  ssn[21] = 386
  ssn[22] = 399
  ssn[23] = 407
  ssn[24] = 415
  ssn[25] = 424
  ssn[26] = 428
  ssn[27] = 432
  ssn[28] = 439
  ssn[29] = 448
  ssn[30] = 467
  ssn[31] = 477
  ssn[32] = 485
  ssn[33] = 500
  ssn[34] = 502
  ssn[35] = 504
  ssn[36] = 508
  ssn[37] = 515
  ssn[38] = 517
  ssn[39] = 519
  ssn[40] = 520
  ssn[41] = 524
  ssn[42] = 525
  ssn[43] = 527
  ssn[44] = 529
  ssn[45] = 530
  ssn[46] = 539
  ssn[47] = 544
  ssn[48] = 573
  ssn[49] = 574
  ssn[50] = 576
  ssn[51] = 579
  ssn[52] = 580
  ssn[53] = 584
  ssn[54] = 585
  ssn[55] = 586
  ssn[56] = 599
  ssn[57] = 728
  var geo = new makeArray(57)
  geo[1] = "New Hampshire"
  geo[2] = "Maine"
  geo[3] = "Vermont"
  geo[4] = "Massachusetts"
  geo[5] = "Rhode Island"
  geo[6] = "Connecticut"
  geo[7] = "New York"
  geo[8] = "New Jersey"
  geo[9] = "Pennsylvania"
  geo[10] = "Maryland"
  geo[11] = "Delaware"
  geo[12] = "Virginia"
  geo[13] = "West Virginia"
  geo[14] = "North Carolina"
  geo[15] = "South Carolina"
  geo[16] = "Georgia"
  geo[17] = "Florida"
  geo[18] = "Ohio"
  geo[19] = "Indiana"
  geo[20] = "Illinois"
  geo[21] = "Michigan"
  geo[22] = "Wisconsin"
  geo[23] = "Kentucky"
  geo[24] = "Tennessee"
  geo[25] = "Alabama"
  geo[26] = "Mississippi"
  geo[27] = "Arkansas"
  geo[28] = "Louisiana"
  geo[29] = "Oklahoma"
  geo[30] = "Texas"
  geo[31] = "Minnesota"
  geo[32] = "Iowa"
 geo[33] = "Missouri"
 geo[34] = "North Dakota"
 geo[35] = "South Dakota"
 geo[36] = "Nebraska"
 geo[37] = "Kansas"
 geo[38] = "Montana"
 geo[39] = "Idaho"
 geo[40] = "Wyoming"
 geo[41] = "Colorado"
 geo[42] = "New Mexico"
 geo[43] = "Arizona"
 geo[44] = "Utah"
 geo[45] = "Nevada"
 geo[46] = "Washington"
 geo[47] = "Oregon"
 geo[48] = "California"
 geo[49] = "Alaska"
 geo[50] = "Hawaii"
 geo[51] = "District of Columbia"
 geo[52] = "Virgin Islands"
 geo[53] = "Puerto Rico"
 geo[54] = "New Mexico"
 geo[55] = "Guam, American Samoa, N. Mariana Isl., Philippines"
 geo[56] = "Puerto Rico"
 geo[57] = "Long-time or retired railroad workers"
 function stripZeros(inputStr) {
 var result = inputStr
 while (result.substring(0,1) == "0") {
 result = result.substring(1,result.length)
 }
 return result
 }
 function isEmpty(inputStr) {
 if (inputStr == "" || inputStr == null) {
 return true
 }
 return false
 }
 function isNumber(inputStr) {
 for (var i = 0; i < inputStr.length; i++) {
 var oneChar = inputStr.substring(i, i + 1)
 if (oneChar < "0" || oneChar > "9") {
 return false
    }
 }
 return true
 }
 function inRange(inputStr) {
 num = parseInt(inputStr)
 if (num < 1 || num > 586 && num < 596 || num > 599 && num < 700 || num > 728) {
 return false
 }
 return true
 }
 function isValid(inputStr) {
 if (isEmpty(inputStr)) {
 alert("Please enter a number into the field before clicking the button.")
 return false
 } else {
 if (!isNumber(inputStr)) {
 alert("Please make sure entries are numbers only.")
 return false
 } else {
 if (!inRange(inputStr)) {
 alert("Sorry, the number you entered is not part of our database.  Try another three-digit number.")
 return false
       }
    }
 }
 return true
 }
 function search(form) {
 var foundMatch = false
 var inputStr = stripZeros(form.entry.value)
 if (isValid(inputStr)) {
 inputValue = inputStr
 for (var i = 1; i <= ssn.length; i++) {
 if (inputValue <= ssn) {
 foundMatch = true
 break
       }
    }
 }
 form.result.value = (foundMatch) ? geo : ""
 form.entry.focus()
 form.entry.select()
 }
 // End -->
</SCRIPT>
</head>


<!-- STEP TWO: Paste this code into the BODY of your HTML document -->

<body>

  <FORM METHOD=post>
  Instructions:
  <OL><LI>Enter the first three digits of a U.S. Social
  Security number in question.</LI>
  <LI>Click on the Search button.</LI>
  <LI>See the corresponding state or territory in the field.</L1>
  </OL>
  <CENTER>
  <P>Enter the first <B>three</B> digits of a Social Security number:
 <INPUT TYPE="text" NAME="entry" SIZE=3>
 <INPUT TYPE="button" VALUE="Search" ONCLICK="search(this.form)">
 <P>
 The Federal Government links this number to: 
 <INPUT TYPE="text" NAME="result" SIZE=50></center>
 <BR>
 <HR>
 <BR><BR><BR>
 <P><B>For the paranoiad:</B> No information you enter here is recorded or monitored - it stays entirely within your browser.
 </CENTER>
 </FORM>


</body>


This code is actually written by movids
Logged

aldo
Official 110mb Guru
********
Offline Offline

Posts: 8004


SMF is ftw :D


WWW
« Reply #4 on: June 22, 2007, 08:48:43 AM »

Nice but im paranoid and i wouldnt want to put my Social Securtity in there just to find out something i already know :-P lol but still looks very nice  smiley
Logged


Slittzle
He touched me with noodle appendage
Loyal 110MB Member
*******
Offline Offline

Posts: 2992


©®ªÞ


WWW
« Reply #5 on: June 23, 2007, 12:56:55 AM »

You should leave the copyrights in, it's from JS Internet -
Code:
http://javascript.internet.com/games/where-born.html
Logged

Pages: [1]   Go Up
Send this topic | Print
Jump to: