Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.)

In reply to Re: Perl vs. Javascript by chromatic
in thread Perl vs. Javascript by CiceroLove

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2021-07-28 10:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found