Is script type="text/perl" OK?
am 14.01.2008 12:50:56 von lg
I've asked this on a html forum but I'll ask it here also.
I have a counter file on my index page which is like below.
Snippet from index.html:
The script is is a perl file which is processed by the server. Is it legal? Will
my counter work (be run as usual)?
Below runs OK too, but I get a "done, but with errors on the page"
What I am trying to do is get rid of the error message and have the counter.pl
execute. Since the server (not the client browser) is doing the running of the
counter.pl I want to know if "
otherwise valid. I could just put the line there and see if I get hits, but I
don't want to find out six months later that it while it does work on many
browsers it does not work on not-so-common-browser and the browser simply quits
interpreting the html on the file and issues a 404 or similar message.
Re: Is script type="text/perl" OK?
am 14.01.2008 13:22:19 von Joost Diepenmaat
lg writes:
> I've asked this on a html forum but I'll ask it here also.
>
> I have a counter file on my index page which is like below.
> Snippet from index.html:
>
>
> The script is is a perl file which is processed by the server. Is it
> legal?
Yes. But then your script is expected to return perl code to the
browser. But unless your script actually returns valid perl and your
browser has a perl scripting plugin (like the ActivePerl PerlScript plugin)
this is probably not what you want.
Note: the
That's probably because your script does not return valid javascript.
> What I am trying to do is get rid of the error message and have the counter.pl
> execute. Since the server (not the client browser) is doing the running of the
> counter.pl I want to know if "
> otherwise valid. I could just put the line there and see if I get hits, but I
> don't want to find out six months later that it while it does work on many
> browsers it does not work on not-so-common-browser and the browser simply quits
> interpreting the html on the file and issues a 404 or similar message.
Some people, like me, have browser scripting disabled, so it won't work
any way. Most counter scripts I've seen are called using an
tag. Whatever you use, just make sure you send back the right kind of
response; an image for an tag, a (javascript) script for a
What does 'counter.pl' contain? If it contains Perl, I'm quite surprised
it runs ok - as I would expect the browser to execute it like it contained
Javascript.
If counter.pl contains javascript, this forum is not the right place to ask.
:}
:} What I am trying to do is get rid of the error message and have the counter.pl
:} execute. Since the server (not the client browser) is doing the running of the
:} counter.pl I want to know if "
:} otherwise valid. I could just put the line there and see if I get hits, but I
:} don't want to find out six months later that it while it does work on many
:} browsers it does not work on not-so-common-browser and the browser simply quits
:} interpreting the html on the file and issues a 404 or similar message.
Eh, the server is interpreting the
>
>That's probably because your script does not return valid javascript.
>
>> What I am trying to do is get rid of the error message and have the counter.pl
>> execute. Since the server (not the client browser) is doing the running of the
>> counter.pl I want to know if "
>> otherwise valid. I could just put the line there and see if I get hits, but I
>> don't want to find out six months later that it while it does work on many
>> browsers it does not work on not-so-common-browser and the browser simply quits
>> interpreting the html on the file and issues a 404 or similar message.
>
>Some people, like me, have browser scripting disabled, so it won't work
>any way. Most counter scripts I've seen are called using an
>tag. Whatever you use, just make sure you send back the right kind of
>response; an image for an tag, a (javascript) script for a
>
>
> What I am trying to do is get rid of the error message and have the counter.pl
> execute. Since the server (not the client browser) is doing the running of the
> counter.pl I want to know if "
> otherwise valid. I could just put the line there and see if I get hits, but I
> don't want to find out six months later that it while it does work on many
> browsers it does not work on not-so-common-browser and the browser simply quits
> interpreting the html on the file and issues a 404 or similar message.
If you want the perl code to run on the server and include its output
in
the page sent to the browser, then you need to make a server-side
include (SSI).
You will also have to enable SSI on the web server and name the file
index.shtml instead of index.html.
--S