Re: JS problem continued
by "Kae Verens" <kverens(at)orbism.com>
|
| Date: |
Sun, 23 Jul 2000 11:02:16 +0100 |
| To: |
David Andrew <davida51(at)swbell.net>, hwg-languages(at)hwg.org |
| In-Reply-To: |
swbell |
| |
todo: View
Thread,
Original
|
|
On 23 Jul 2000, at 1:26, David Andrew wrote:
> The script can be found at
> http://www.gggraphics.net/JS_Class/cp_7_1.htm
here're the relevant lines
var USStates = new Array(1)
USStates[0] = "Alabama"
USStates[1] = "Alaska"
var stateEntered = new Array(1)
stateEntered[0] = 1819
stateEntered[1] = 1959
function getStateDate()
{
var selectedState = document.entryForm.entry.value
for ( var i = 0; i < USStates.length; i++)
{
if (USStates[i] == selectedState)
{
break
}
}
alert(" that State entered the Union in " + stateEntered[i] + ".")
// "i" is out of scope here
// try putting the alert line where "break" is above
}
+================================================+
| Contact Juggler http://www.contactjuggling.org | Kae
| System Administrator http://www.orbism.com | Verens
+================================================+
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.