In my opinion, Javascript is best used for glue to hold together a web application, and for minor field validation (if at all). The load time of a page, if written in javascript coompared with perl/cgi, may increase, with the added disadvantage that the spinning globe (or whatever the browser uses to indicate waiting for a request) will stop while the javascript is rendering the page.

You will, of course, eliminate the perl compile-time delay :), which is less of an issue if your server has mod_perl or its ilk.

In terms of its use as glue, Javascript may be used to tie form fields together in a coherent way, such as disabling a set of controls depending upon the state of a checkbox or radio button, etc.

It also potentially has uses in rendering very large tables, since the download time can be shorter if the data is in javascript arrays than in generated HTML. This last use is controversial, since it obviously won't work if the browser has Javascript disabled.


In reply to Re: speed : client or server side by dmmiller2k
in thread speed : client or server side by silent11

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.