Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    '800a0401' error

    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>

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    *me* Feels kinda dumb after reading glenn's post lol...I guess I don't know much...
    Last edited by Brandoe85; 01-12-2005 at 02:32 AM. Reason: eh...

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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%>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Quote Originally Posted by glenngv
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •