[Javascript] silly question

Clark, Michael Michael.Clark at OFM.WA.GOV
Thu Jul 19 13:06:22 CDT 2001


Being a newbie at JavaScript (and grateful for this list) I have to say that
as an ASP server-side scripter using VBScript, now that I'm doing
client-side in JavaScript it is sometimes hard to keep in mind that whereas
VBScript doesn't care what case your script code is in, JavaScript is very
very case-sensitive.  Take this "If" vs "if" thing as an instructive
example.  One wishes the JS interpreter could come up with a better error
message than "missing ;", too.  

I have been skewered more than once by JS case-sensitivity and by forgetting
those darned semi-colons.  Oh, well...

-----Original Message-----
From: Rees, Mark (TWIi London) [mailto:mrees at twii.net]
Sent: Thursday, July 19, 2001 8:31 AM
To: 'javascript at LaTech.edu'
Subject: RE: [Javascript] silly question


Try if instead of If

Mark

-----Original Message-----
From: Shaun Chatterton [mailto:shaun at evolutioninteractive.co.uk]
Sent: 19 July 2001 16:20
To: dsaf
Subject: [Javascript] silly question


Can anyone tell me what is wrong with the following snippet of code
It is designed to allow the user to choose which url the contents of his
form is sent to for processing.

I keep getting errors suggesting I have a ";" missing, but I haven't a clue
where it's supposed to be.

Any help greatly appreciated.

<HTML>
<HEAD>
<SCRIPT Language=JavaScript>

function whereto(option) {
	If (option == "output1"){varOutput = "www.ibm.com";}
	If (option == "output2"){varOutput = "www.zeppotron.com";}
	return varOutput;
	}


</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD="post" ACTION= varOutput >
<INPUT TYPE="text" name="field">
</FORM>
<A HREF="#" onClick="whereto('output1');">Click here to send field to
IBM</A>
<BR><BR>
<A HREF="#" onClick="whereto('output2');">Click here to send field to the
Guardian</A>
</BODY>
</HTML>

Shaun Chatterton
Evolution Interactive
Tel 0113 394 4220

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list