The javascript: label inside the event handler is cargo cult nonsense, drop it.

The only place where the javascript: prefix once made sense was in the href attribute of an a element (i.e. <a href="javascript:foo()">...</a>), where it was interpreted as a pseudo-protocol. This was needed for Netscape Navigator < 2.0, Internet Explorer < 3.0, Opera < 5.12, and other long forgotten software from the dawn of the WWW decades ago, lacking the standard onclick event handler.

For modern web pages, don't insert any Javascript at all into the HTML document, load it from an external resource and use DOM methods to add event handlers. Libraries like jQuery make this much easier than coding everything manually.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: Using CGI's start_html to add attributes to <body> by afoken
in thread Using CGI's start_html to add attributes to <body> by cyffka

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.