[Techtalk] why is Active X in web pages evil, but not Perl/PHP/Javascript?

Akkana Peck akkana at shallowsky.com
Thu Jan 20 13:08:35 EST 2005


Mary writes:
> Neither do I, but something about Carla's wording suggested a source of
> confusion, possibly suggesting that if you get a browser compatibility
> problem with client side scripting, the solution is easy: use server
> side scripting! But since they actually have different purposes, you
> can't solve compatibility problems that way, hence my second mail.

Most of the time, I agree, they have different purposes.  But
sometimes they really are both valid ways of accomplishing the
same goal.

For instance, I have several pages on my site that do astronomical
calculations of one sort or another, and display the result.
In some cases the calculations are done on the client side
(in JavaScript or Java) and in other cases, they're done on
the server side (in various languages from Python to C to PHP).

In the cases where the calculations are done on the client side,
I have all sorts of difficulties: I have to worry about whether the
language handles time zones correctly (JS generally does, Java often
doesn't), whether the language can parse a time string, how to fail
gracefully if the user has that language disabled in their browser
and what sort of static page to show in that case ... the list goes
on and on.  There's so much variation among browser implementations
of JavaScript and Java that I can't count on anything.  On the server
side, I can answer all those questions.  So in a case like this,
as long as the page doesn't have to respond interactively to the user,
moving the code from the client to the server in order to avoid
browser incompatibilities really is an option, just as Carla wondered.

You could argue that if the page doesn't have to respond to user
interaction, then the work belongs on the server anyway.  Perhaps
that's true.  But there are edge cases where there might be a little
user interaction, or you want to leave open the possibility for
adding some later.  It's also useful to have code that can run in
a standalone browser without needing a web server, or on some other
device like a phone or PDA.  The choice isn't always obvious.

	...Akkana


More information about the Techtalk mailing list