PDA

View Full Version : '800a0401' error


lethalweapons1
01-11-2005, 10:38 PM
I just started trying to learn javascript and copied this example from a book. I keep getting the '800a0401' Expected end of statement error for this line:

var myNumber; (the entire code is below)

Does anyone know why I get this error. I'm trying to get a basic bit of code to work, then move on to other more complicated coding.

Thanks!

<html>

<head>
<title>My Number was 101</title>
</head>

<body>
<%
var myNumber;
for (myNumber = 1; myNumber <= 10; myNumber++)
{
%>
<P>
<STRONG>The Number this time is <%=myNumber%></STRONG>
</P>
<%
}
%>
</body>

</html>

Brandoe85
01-11-2005, 10:42 PM
*me* Feels kinda dumb after reading glenn's post :o lol...I guess I don't know much...

glenngv
01-12-2005, 01:46 AM
He is using server-side Javascript in ASP, which is just fine.
The code is ok except for the missing @language directive. Since the default scripting language for ASP is VBScript, you have to specify Javascript at the top of the page if you want to use it.

<%@language=Javascript%>

Brandoe85
01-12-2005, 02:29 AM
He is using server-side Javascript in ASP, which is just fine.
The code is ok except for the missing @language directive. Since the default scripting language for ASP is VBScript, you have to specify Javascript at the top of the page if you want to use it.

<%@language=Javascript%>
Oh,(my bad) I didn't know that..thats cool then.