Error on loading ASP page with VBScript

Discussion in 'ASP General' started by Frank, Aug 20, 2003.

  1. Frank

    Frank Guest

    When I used IE 6.0 to view the ASP page on Window 2000
    server PC, I encountered the error message: "Expected end
    of statement".

    The ASP page code is as:
    ******************************************************
    <script language="VBScript">
    function vb_Test(ptValue)
    vb_Test = ptValue
    end function
    </script>
    <HTML>
    <BODY onLoad="document.body.style.cursor='default';">
    test text
    </BODY>
    </HTML>
    ******************************************************

    This problem only happens when the VBScript code block is
    at the beginning of the ASP page.

    Seems the browser treats the single quote that exists in
    the inline event JavaScript code as a comment symbol in
    VBScript and it would not tolerate it.

    To solve this problem:
    1. Add a block of JavaScript code block above that
    VBScript code block.
    2. Remove the single quote in the inline event code.
    3. Move the inline event code to a JavaScript function.

    Any one has any idea or aware of this problem?

    Thanks,
    Frank
    ..
     
    Frank, Aug 20, 2003
    #1
    1. Advertising

  2. Frank

    Curt_C [MVP] Guest

    FYI, it's not an ASP issue. You are doing CLIENTSIDE VBScript.... (eeek).
    Stick to javascript on the client for compatability.

    --
    ----------------------------------------------------------
    Curt Christianson (Software_AT_Darkfalz.Com)
    Owner/Lead Designer, DF-Software
    http://www.Darkfalz.com
    ---------------------------------------------------------
    ...Offering free scripts & code snippits for everyone...
    ---------------------------------------------------------


    "Frank" <> wrote in message
    news:036f01c36761$46d049d0$...
    > When I used IE 6.0 to view the ASP page on Window 2000
    > server PC, I encountered the error message: "Expected end
    > of statement".
    >
    > The ASP page code is as:
    > ******************************************************
    > <script language="VBScript">
    > function vb_Test(ptValue)
    > vb_Test = ptValue
    > end function
    > </script>
    > <HTML>
    > <BODY onLoad="document.body.style.cursor='default';">
    > test text
    > </BODY>
    > </HTML>
    > ******************************************************
    >
    > This problem only happens when the VBScript code block is
    > at the beginning of the ASP page.
    >
    > Seems the browser treats the single quote that exists in
    > the inline event JavaScript code as a comment symbol in
    > VBScript and it would not tolerate it.
    >
    > To solve this problem:
    > 1. Add a block of JavaScript code block above that
    > VBScript code block.
    > 2. Remove the single quote in the inline event code.
    > 3. Move the inline event code to a JavaScript function.
    >
    > Any one has any idea or aware of this problem?
    >
    > Thanks,
    > Frank
    > .
    >
    >
     
    Curt_C [MVP], Aug 20, 2003
    #2
    1. Advertising

  3. Frank

    Curt_C [MVP] Guest

    Re: have to use the VBScript code

    but what you are doing isn't ASP...
    <script language=VBScript>...</script> is CLIENTSIDE, not SERVER


    --
    ----------------------------------------------------------
    Curt Christianson (Software_AT_Darkfalz.Com)
    Owner/Lead Designer, DF-Software
    http://www.Darkfalz.com
    ---------------------------------------------------------
    ...Offering free scripts & code snippits for everyone...
    ---------------------------------------------------------


    "Frank" <> wrote in message
    news:073f01c36780$433d6e00$...
    > I have to use the VBScript code in this page. It is
    > basically a simplified ASP page.
    >
    > Thanks.
    >
    > >-----Original Message-----
    > >FYI, it's not an ASP issue. You are doing CLIENTSIDE

    > VBScript.... (eeek).
    > >Stick to javascript on the client for compatability.
    > >
    > >--
    > >----------------------------------------------------------
    > >Curt Christianson (Software_AT_Darkfalz.Com)
    > >Owner/Lead Designer, DF-Software
    > >http://www.Darkfalz.com
    > >---------------------------------------------------------
    > >...Offering free scripts & code snippits for everyone...
    > >---------------------------------------------------------
    > >
    > >
    > >"Frank" <> wrote in message
    > >news:036f01c36761$46d049d0$...
    > >> When I used IE 6.0 to view the ASP page on Window 2000
    > >> server PC, I encountered the error message: "Expected

    > end
    > >> of statement".
    > >>
    > >> The ASP page code is as:
    > >> ******************************************************
    > >> <script language="VBScript">
    > >> function vb_Test(ptValue)
    > >> vb_Test = ptValue
    > >> end function
    > >> </script>
    > >> <HTML>
    > >> <BODY onLoad="document.body.style.cursor='default';">
    > >> test text
    > >> </BODY>
    > >> </HTML>
    > >> ******************************************************
    > >>
    > >> This problem only happens when the VBScript code block

    > is
    > >> at the beginning of the ASP page.
    > >>
    > >> Seems the browser treats the single quote that exists in
    > >> the inline event JavaScript code as a comment symbol in
    > >> VBScript and it would not tolerate it.
    > >>
    > >> To solve this problem:
    > >> 1. Add a block of JavaScript code block above that
    > >> VBScript code block.
    > >> 2. Remove the single quote in the inline event code.
    > >> 3. Move the inline event code to a JavaScript function.
    > >>
    > >> Any one has any idea or aware of this problem?
    > >>
    > >> Thanks,
    > >> Frank
    > >> .
    > >>
    > >>

    > >
    > >
    > >.
    > >
     
    Curt_C [MVP], Aug 21, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ChucRock
    Replies:
    2
    Views:
    5,834
    Lucas Tam
    Apr 16, 2005
  2. BooGhost
    Replies:
    0
    Views:
    381
    BooGhost
    Aug 8, 2008
  3. Joe
    Replies:
    2
    Views:
    415
    Martin Honnen
    Apr 25, 2009
  4. Peter
    Replies:
    3
    Views:
    254
    joker
    Aug 19, 2004
  5. NanQuan
    Replies:
    5
    Views:
    516
    NanQuan
    Oct 23, 2004
Loading...

Share This Page