wierd error message in asp page

Discussion in 'ASP General' started by c676228, Apr 30, 2007.

  1. c676228

    c676228 Guest

    Hi all,
    I have a page when run in browser(firefox), it has some error message from
    from javascript console. It says
    Error: Expected ':' but found ';'. Declaration dropped.
    Source File: https://www.xxx.com/select2007_step1.asp
    Line: 0

    Bu the first 10 line of code are:

    <%
    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>Flexible Travel Insurance Quote</title>

    It seems to me that it has nothing to do Javascript, it is asp.
    Can you shed a light on me?
    After I remove this part:<%
    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr
    %>
    It still give me the error message.


    Betty
    c676228, Apr 30, 2007
    #1
    1. Advertising

  2. c676228 wrote:
    > Hi all,
    > I have a page when run in browser(firefox), it has some error message
    > from from javascript console. It says
    > Error: Expected ':' but found ';'. Declaration dropped.
    > Source File: https://www.xxx.com/select2007_step1.asp
    > Line: 0
    >
    > Bu the first 10 line of code are:
    >
    > <%
    > pStr = "private, no-cache, must-revalidate"
    > Response.ExpiresAbsolute = #2000-01-01#
    > Response.AddHeader "pragma", "no-cache"
    > Response.AddHeader "cache-control", pStr
    > %>
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1"/> <title>Flexible Travel Insurance Quote</title>
    >
    > It seems to me that it has nothing to do Javascript, it is asp.


    Why? What is making you say that? Why would an ASP vbscript error be
    raised in a Javascript console?


    > Can you shed a light on me?
    > After I remove this part:<%
    > pStr = "private, no-cache, must-revalidate"
    > Response.ExpiresAbsolute = #2000-01-01#
    > Response.AddHeader "pragma", "no-cache"
    > Response.AddHeader "cache-control", pStr
    > %>
    > It still give me the error message.
    >

    And if you remove every other bit of ASP code, I bet you will still get
    the error ... unless removing the ASP code causes you to inadvertantly
    fix or delete the javascript code that is causing the error.

    Your problem is in a line of code containing a colon, probably a var
    statement. The error it is causing is preventing the rest of the code in
    the page from executing leading to the confusion.




    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Apr 30, 2007
    #2
    1. Advertising

  3. c676228

    c676228 Guest

    HI Bob,
    i always use firefox javaconsole to debug my javascript and it seems it
    always give the right line number all the time. That's why I am so confused
    when I look at the so-called line 0.
    I will look at if there is : in the javascript.
    Thanks you
    --
    Betty


    "Bob Barrows [MVP]" wrote:

    > c676228 wrote:
    > > Hi all,
    > > I have a page when run in browser(firefox), it has some error message
    > > from from javascript console. It says
    > > Error: Expected ':' but found ';'. Declaration dropped.
    > > Source File: https://www.xxx.com/select2007_step1.asp
    > > Line: 0
    > >
    > > Bu the first 10 line of code are:
    > >
    > > <%
    > > pStr = "private, no-cache, must-revalidate"
    > > Response.ExpiresAbsolute = #2000-01-01#
    > > Response.AddHeader "pragma", "no-cache"
    > > Response.AddHeader "cache-control", pStr
    > > %>
    > > <html>
    > > <head>
    > > <meta http-equiv="Content-Type" content="text/html;
    > > charset=iso-8859-1"/> <title>Flexible Travel Insurance Quote</title>
    > >
    > > It seems to me that it has nothing to do Javascript, it is asp.

    >
    > Why? What is making you say that? Why would an ASP vbscript error be
    > raised in a Javascript console?
    >
    >
    > > Can you shed a light on me?
    > > After I remove this part:<%
    > > pStr = "private, no-cache, must-revalidate"
    > > Response.ExpiresAbsolute = #2000-01-01#
    > > Response.AddHeader "pragma", "no-cache"
    > > Response.AddHeader "cache-control", pStr
    > > %>
    > > It still give me the error message.
    > >

    > And if you remove every other bit of ASP code, I bet you will still get
    > the error ... unless removing the ASP code causes you to inadvertantly
    > fix or delete the javascript code that is causing the error.
    >
    > Your problem is in a line of code containing a colon, probably a var
    > statement. The error it is causing is preventing the rest of the code in
    > the page from executing leading to the confusion.
    >
    >
    >
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    >
    c676228, Apr 30, 2007
    #3
  4. Hi Betty,

    If the error is raised from client-side javascript console, I think you
    should check the rendered out HTML source through webbrowser's "View
    Source" rather than server-side asp content. The line number should be
    matching the content of the client-side rendered page source.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], May 1, 2007
    #4
  5. c676228

    c676228 Guest

    Hi Steven,
    You are absolutely right. I got it. Most of the time it seems it doesn't
    give me any trouble.
    Thank you.
    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Hi Betty,
    >
    > If the error is raised from client-side javascript console, I think you
    > should check the rendered out HTML source through webbrowser's "View
    > Source" rather than server-side asp content. The line number should be
    > matching the content of the client-side rendered page source.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    c676228, May 25, 2007
    #5
  6. c676228

    Tim Slattery Guest

    c676228 <> wrote:

    >Hi all,
    >I have a page when run in browser(firefox), it has some error message from
    >from javascript console. It says
    >Error: Expected ':' but found ';'. Declaration dropped.
    >Source File: https://www.xxx.com/select2007_step1.asp
    >Line: 0
    >
    >Bu the first 10 line of code are:
    >
    ><%
    >pStr = "private, no-cache, must-revalidate"
    >Response.ExpiresAbsolute = #2000-01-01#
    >Response.AddHeader "pragma", "no-cache"
    >Response.AddHeader "cache-control", pStr
    >%>
    ><html>
    ><head>
    ><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    ><title>Flexible Travel Insurance Quote</title>
    >
    >It seems to me that it has nothing to do Javascript, it is asp.


    It's pointing to something in the HTML that it received, not the
    original ASP file, which it knows nothing about. Use the "View Source"
    option, and see what you can find in there.

    Directing you to line 0 is no good, it kind of implies that it's very
    confused.

    --
    Tim Slattery
    MS MVP(DTS)

    http://members.cox.net/slatteryt
    Tim Slattery, May 25, 2007
    #6
    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. VB Programmer
    Replies:
    1
    Views:
    579
    VB Programmer
    Jul 10, 2003
  2. David Li

    Wierd error - urgent!!!

    David Li, Apr 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,500
    nishan
    Jul 5, 2009
  3. VB Programmer

    wierd bloodhound virus message in asp.net

    VB Programmer, Apr 21, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    1,597
    VB Programmer
    Apr 23, 2006
  4. Ken Varn
    Replies:
    6
    Views:
    2,015
    Aamir Ghanchi
    Apr 13, 2007
  5. E
    Replies:
    1
    Views:
    92
    Evertjan.
    Dec 1, 2005
Loading...

Share This Page