[ back to toc ]

Counter script question

Date: 2002/01/31 10:35

Q:
Hi Peter,

I am almost finished setting up a counter script on my image hosting site
that my users can sign up for and have control over their own counters for
their auctions. It works great till I go to list an auction and place the
code in for the counter as the auction house does not allow Javascript in
the auction description.

if I use the path to the counter in the browser window it shows up
(http://www.dynamicwebspace.com/counters/cgi-bin/counter.cgi?id=sweetness)

but if I just add the code in a page it shows up as red x's and wont show
the gifs.
It does still count each reload so the script is working even though the
gifs don't show up.
here is an example;
http://www.dynamicwebspace.com/counters/CountTest.html
the counter that shows up is using the Javascript to display it, the one
below is using <img src=
is there anyway to get the gifs to show for the counter and not have to
use Javascript to make it work??
I have seen counters from other sites that dont use javascript to show the
images so I am thinking that there is something that needs to be changed
in the script ?

thank you in advance for any help you can give me,
*NAME-DELETED* *NAME-DELETED*

A:
The CGI program in this case generates a piece of JavaScript. This
JavaScript contains the counter and executing prints the image references
into the HTML that display the GIFs finally.

The line in your page:

<img
src=http://www.dynamicwebspace.com/counters/cgi-bin/counter.cgi?id=sweetne
ss>

is rubbish. This tires to download an image, but what is gets is a piece
of JavaScript that it eventually can not display.

To have the counter displayed you need only the

<script language="JavaScript" type="text/javascript"
src="http://www.dynamicwebspace.com/counters/cgi-bin/counter.cgi?id=sweetn
ess"></script>

line in your HTML.

Regards,.

[ back to toc ]