473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Script Error

JA
Hi,

I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2.

There is no error on most other computers, and the products show, but
another script on the page, an article title scroller, stops - on most
computers, but not all. It says "no articles available".

I've tried the script on an asp page and a htm page, all by itself, but it
still doesn't work. I tried changing all kinds of settings in my browsers,
but nothing helps. I'm on XP, SP2, which I've heard has some problems
handling javascripts. I don't know if that's true, but if it is, I know that
lots of other people will have the same problem as me when they view the
page. Actually, I think it is a good thing, that my computer is pointing out
this error. I get the error message in IE6, but in NS8 and FF, I just don't
see the products. No error message.

Anyway, here are the first three lines of the script:

<%
if TRIM(request.servervariables("http_referer")) = "" then
%>

Using spellcheck, I found that referer is spelled wrong, it should be
referrer. I don't know if that is right for javascript (or asp?), but
correcting it didn't make a difference.

The script is JavaScript on an asp page, and it is called in an htm page.

Is the error obvious from the 3 lines?

Thanks for any help,

JA

Aug 12 '05 #1
8 2953
"JA" <ja*****@kc.rr.com> wrote in message
news:zc****************@tornado.rdc-kc.rr.com...
Hi,

I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2.

There is no error on most other computers, and the products show, but
another script on the page, an article title scroller, stops - on most
computers, but not all. It says "no articles available".

I've tried the script on an asp page and a htm page, all by itself, but it
still doesn't work. I tried changing all kinds of settings in my browsers,
but nothing helps. I'm on XP, SP2, which I've heard has some problems
handling javascripts. I don't know if that's true, but if it is, I know that lots of other people will have the same problem as me when they view the
page. Actually, I think it is a good thing, that my computer is pointing out this error. I get the error message in IE6, but in NS8 and FF, I just don't see the products. No error message.

Anyway, here are the first three lines of the script:

<%
if TRIM(request.servervariables("http_referer")) = "" then
%>

Using spellcheck, I found that referer is spelled wrong, it should be
referrer. I don't know if that is right for javascript (or asp?), but
correcting it didn't make a difference.

The script is JavaScript on an asp page, and it is called in an htm page.

Is the error obvious from the 3 lines?

Thanks for any help,

JA


"http_referer" is blocked by many firewalls; (e.g. Norton).
Aug 12 '05 #2
JA

I have Zone Alarm, would that do it? Also Norton Anti-Virus.

What can be done about it? What can it be changed to that wouldn't get
blocked?

Thanks, JA
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ve*****************************************@c omcast.com...
"JA" <ja*****@kc.rr.com> wrote in message
news:zc****************@tornado.rdc-kc.rr.com...
Hi,

I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2.

There is no error on most other computers, and the products show, but
another script on the page, an article title scroller, stops - on most
computers, but not all. It says "no articles available".

I've tried the script on an asp page and a htm page, all by itself, but
it
still doesn't work. I tried changing all kinds of settings in my
browsers,
but nothing helps. I'm on XP, SP2, which I've heard has some problems
handling javascripts. I don't know if that's true, but if it is, I know

that
lots of other people will have the same problem as me when they view the
page. Actually, I think it is a good thing, that my computer is pointing

out
this error. I get the error message in IE6, but in NS8 and FF, I just

don't
see the products. No error message.

Anyway, here are the first three lines of the script:

<%
if TRIM(request.servervariables("http_referer")) = "" then
%>

Using spellcheck, I found that referer is spelled wrong, it should be
referrer. I don't know if that is right for javascript (or asp?), but
correcting it didn't make a difference.

The script is JavaScript on an asp page, and it is called in an htm page.

Is the error obvious from the 3 lines?

Thanks for any help,

JA


"http_referer" is blocked by many firewalls; (e.g. Norton).

Aug 12 '05 #3
JA wrote:
I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2. Anyway, here are the first three lines of the script: <%
if TRIM(request.servervariables("http_referer")) = "" then
%>
This looks like ASP/VBScript, not JavaScript. If your browser is reporting
an error on line 2, then its line 2 of the output that the browser
receives, not line 2 of the program that generates the output.
Using spellcheck, I found that referer is spelled wrong, it should be
referrer.


http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

The Referer[sic] request-header field allows the client to specify, for
the server's benefit, the address (URI) of the resource from which the
Request-URI was obtained (the "referrer", although the header field is
misspelled.)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 12 '05 #4
"JA" <ja*****@kc.rr.com> wrote in message
news:6K****************@tornado.rdc-kc.rr.com...

I have Zone Alarm, would that do it? Also Norton Anti-Virus.

What can be done about it? What can it be changed to that wouldn't get
blocked?

Thanks, JA


[snip]

http://www.hotdogblog.com/modules/smartfaq/index.php

For security reasons, when you post a reply etc, the site checks that you
have actually come from a page on the forum using what is called a
HTTP_REFERER. This ensures that database entries can only come from the
right page, and stops any external scripts (and would-be-if-they-could-be
hackers)from entering info from souces OTHER than the forum reply page
itself.

Unfortunately, some firewall and web filtering software, such as some
versions of Zone Alarm, block HTTP_REFERER's by default.

# Disable WebWasher Standard Filter/URL Filter
# Disable any "ad blocking" software
# Disable any Pop-up blockers

----------------------------------------------------------
Zone Alarm Pro:

1. Click Privacy
2. Click Cookie Control
3. Click Custom
4. Uncheck "remove private header information"

Aug 12 '05 #5
McA
> Anyway, here are the first three lines of the script:
<%
if TRIM(request.servervariables("http_referer")) = "" then
%>


Use request.servervariables("HTTP_REFERRER")

BTW this is VBS
Aug 12 '05 #6
"JA" <ja*****@kc.rr.com> wrote in message
news:zc****************@tornado.rdc-kc.rr.com...
Hi,

I have this JavaScript that is supposed to show random products from my
database, and show something different every time you refresh or revisit.
But I keep getting an error - on my computer - that says Syntax Error in
Line 2. <%
if TRIM(request.servervariables("http_referer")) = "" then
%> The script is JavaScript on an asp page, and it is called in an htm page.


That looks more like vbscript which only works on Internet Explorer and
servers which allow it.
Also, don't forget the "end if". You can only omit it when the if/then
statement is all on one line.

eg:
if {condition} then {do something}
if {condition} then
{do something else}
end if

As for the spelling of "referer", try this link
http://en.wikipedia.org/wiki/Referer
Aug 12 '05 #7
[snip]
That looks more like vbscript which only works on Internet Explorer and
servers which allow it.


[snip]

"vbscript which only works on Internet Explorer"
This would be true if it were client-side script.

ASP runs server-side.
Aug 12 '05 #8
On Friday 12 August 2005 19:05, McKirahan(Ne**@McKirahan.com) wrote in
message <jK********************@comcast.com>
[snip]
That looks more like vbscript which only works on Internet Explorer and
servers which allow it.


[snip]

"vbscript which only works on Internet Explorer"
This would be true if it were client-side script.

ASP runs server-side.


[Danny@Kendal, posting from home]

Next you'll be telling me that PHP and MySql are server-side as well. ;-)
Aug 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
15
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
3
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
7
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.