JavaScript and CGI: General questions
Joel Hammer
Joel
Mon May 17 11:35:12 PDT 2004
I would like to get some advice on javascript and CGI. My ignorance here
is large.
I am thinking of putting up some documents on a web site for general
access. I have some general questions about javascript and CGI related
to this.
What level of javascript (1.0, 1.2, 1.3, who knows) would it be
reasonable at this point in time to expect my visitors to have? I
am not a professional and can't write javascript for every possible
OS/browser/java script version/javascript implementation combination.
I am aiming at the mass market. I would think accommodating Netscape
4.75 (windows) would be reasonable, but I will have to concentrate on
supporting Internet Explorer, of course. (I have already hit a stonewall
trying to accommodate netscape 6.2 for linux. I hope I can get around that
but I don't have time for it now, and very few of my potential visitors
will be using that!)
The bane of javascripters seems to be the diversity of javascript. Anyone
who likes freedom of choice will love writing javascripts. Is there a way
to find out what versions of javascript a particular browser supports,
without sniffing around for hours looking for documentation somewhere,
which might be wrong or misleading in any case? The ideal thing would be
to find some clever javascript code which would take a browser through
its paces and look for what it can and cannot support. An example of
a problem I never anticipated is as follows:
Browsers vary in their fault tolerance, Opera and
netscape overlooked a missing quotation mark around
a button definition but Explorer would not. So,
it looks like every single script has to be tested
against every single browser before you can be sure
it will run.
A second related question is this: Does using CGI scripts in preference
to client side javascript make web pages more accessible to diverse
browsers? My web pages will be essentially a bunch of forms, which need a
lot of javascript like processing to be useful to the user (simple math,
reformatting, etc.) Would CGI avoid client browser incompatibility? Also,
and perhaps very important, since CGI can use anything for scripting
(like PERL and even sed and bash), could I avoid having to hassle so
much with javascript (maybe avoid javascript entirely) and just spend
most of my effort writing PERL scripts?
A third question relates to prevention of piracy. I will be spending a
lot of time preparing these forms. I intend to charge for their use. If
I use client side javascript only, then anyone could just download the
form off my web site and use it, without compensating me for my effort.
Is there a way to prevent this if you are just using client side javascript?
Would using CGI scripting prevent such piracy?
Although I tend to commercialize this effort, the cash flow may be
miniscule, so I can't afford at this point to hire professional help.
Any input appreciated,
Joel
More information about the Linux-users
mailing list