Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Perl vs. Javascript

by chromatic (Archbishop)
on Mar 07, 2001 at 22:16 UTC ( #62795=note: print w/replies, xml ) Need Help??

in reply to Perl vs. Javascript

Unless you're in an environment where you can count on people having JavaScript enabled, you will still have to do input validation on the server. (Even then, I wouldn't trust the client and would perform validation anyway.)

In my opinion, just about the only reason to use JavaScript is to improve the rather poor UI available with the standard HTML widgets. With a bit of client-side scripting, you can autofill boxes, bind buttons to functions, and make things slightly easier. As an example, consider the Message Inbox at Everything2. If you hit a 'Reply' button next to a private message, it fills in a textbox with the commands to respond to the sender and gives that textbox focus, so you can start typing immediately.

Even better, if you have the 'autofill' checkbox enabled, and are using a newer browser than Netscape 4.7x, you can simply run the mouse cursor over the comment and it will autofill the box.

It's also possible to send extra data to the web browser with a module like WDDX and update available selections on the client side.

Just beware -- this does not make user data any more secure, and it should degrade gracefully, unless you can guarantee that nearly all users will have JavaScript enabled for your site. (Private intranet site? Yes. Public? Probably not.)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://62795]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-08-05 14:45 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (44 votes). Check out past polls.