[thelist] Dumb Question (Javascript) but still causing difficulties

James Aylard evolt at pixelwright.com
Wed May 12 11:59:03 CDT 2004


Rob Smith wrote:

> The use on "javascript:" inside an event handler is redundant and is
> hurting my eyes.
>
> onclick=""
> onsubmit=""
> etc...
>
> should *not* have the "javascript:" bit. Ever.

    I disagree. For those who have written both JavaScript/JScript and
VBScript client-side for Internet Explorer, it is sometimes necessary to
prefix an inline script or function call with a scripting language
pseudo-protocol when that bit of script is in a language other than the
default scripting language of the page (typically, the default scripting
language for the page is determined by the language of the first script
block in the page; if no script block is supplied, the page language
defaults to JScript).
    So, in most cases (when only one client-side scripting language is used
within a page) it is entirely unnecessary to supply a scripting-language
protocol in a function call, but in some cases it is necessary.

James Aylard

P.S. - Sorry for that last unintended post.



More information about the thelist mailing list