[Israel.pm] Java Script in Web-Pages
shlomif at iglu.org.il
Wed Feb 11 09:05:51 PST 2004
In Gabor's lecture in the last meeting, the question was raised about using
Java Script in HTML. Now first here's some explanation:
When HTML first started it was served by the server and brought to the client,
who had to either follow links, fill forms, etc. Starting at Netscape 2.0, a
technology called Java Script (or JS for short) was introduced which enabled
writing scripts to manipulate the HTML page elements that will run on the
client side. What it means, is that I can tell my script to reject a form
submission if one of the fields does not contain a valid telephone number,
page and even change the HTML and DOM (Document Object Model). It is now a
W3C standard titled "ECMAScript". The JS language is a bit lame in comparison
to more serious languages like Perl and Python (and even Java), but is still
Turing complete and usable.
So should you use it?
server will receive correct input. A malicious user (let's say a cracker) can
make sure that your server-side scripts are sane. Maintaining both a a
server-side logic and an equivalent client-side logic can become a huge
Explorer seems to have a mind of his own which differs considerably from
generated from code generators, works only there, and not on other browsers.
This is a huge headache for users of Mozilla, Opera and non-Windows operating
system. If people complain because of that, don't be surprised.
is heavily frowned upon by professional web-designers. One can see that in the
better. Or a Java-Script animated navigation menu instead of a simple
click-and-reload one, which achieves much the same effect.
based bug tracker, then if you click on the product you get a list of its
huge headache. Also, getting a meaningful warning about the form before it is
submitted can save the user the frustration of waiting for the server to
properly. This is something any Linux user can tell you about dysfunctional
forms and pages that appear in poorly-coded Israeli sites. Not only that, but
on Google (for example) except for their front page. Compare it to more
usable sites like these of IBM, Yahoo, or Microsoft (which have many pages on
put you in a big problem.
It could have been disabled, or the user is using lynx.
There may be other things I'm forgetting.
(which is pretty useless, because you'll need an extremely fast machine to
run it in real-time, but still cute and thought-provoking) I keep my HTML
small in size and simply relies on the server to do all the sanity-checking
have trouble maintaining, is not my idea of keeping myself out of an asylum.
(open-source or otherwise) software packages, where it is indeed appropriate.
client-side form validation callbacks in form generation routines. etc. This
is because, then the developer of the product can make sure it is indeed
portable, and working perfectly on all browsers.
Usually just passing things back to the server will simplify your life
for software for internal use or such that is deployed only on one or a few
web-sites, is a recipe for disaster.
logic are maintained by two different people. I'm planning to switch to TWiki
(or perhaps Moin-Moin) for my only deployment of it on the Perl-Begin site.
(other than that, it's a very nice Wiki, but this is a huge issue)
Shlomi Fish shlomif at iglu.org.il
I don't believe in fairies. Oops! A fairy died.
I don't believe in fairies. Oops! Another fairy died.
More information about the Perl