In general, I recommend avoiding any dependency on JavaScript in a Web site. A high enough proportion of Web users have JavaScript disabled to cause problems. Popular sites relying on JavaScript that I've worked on tend to receive a small amount of mail from users who have problems using the site. I suspect most users encountering problems go elsewhere without contacting anyone.

Most features that JavaScript offers can be recreated using a combination of HTML, server side code and other techniques that will function in a wide range of environments. Several features of JavaScript (pop-up windows, window resizing) are annoying, so they're worth avoiding anyway.

One advantage of client-side code is that no round-trip to the server is required. I recommend using JavaScript form validation when your budget allows. Of course, server side validation is essential too - never trust client software!

JavaScript can add to the user's experience in some ways, such as automatic redirection to another page within SELECT lists. I recommend using JavaScript in such cases, provided you think carefully about how the site will work when JavaScript is disabled or unavailable.

In short, I see no harm in using JavaScript to enhance your site, provided it is used only for enhancement and not as an essential part of the experience.


In reply to Re: CGI and JavaScript by tomhukins
in thread CGI and JavaScript by stuffy

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.