wierd error message in asp page

C

c676228

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
 
B

Bob Barrows [MVP]

c676228 said:
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.
 
C

c676228

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
 
S

Steven Cheng[MSFT]

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.
 
C

c676228

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

Tim Slattery

c676228 said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top