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

Emma Jane Hogbin emmajane at xtrinsic.com
Wed May 12 13:20:22 CDT 2004


On Wed, May 12, 2004 at 09:59:03AM -0700, James Aylard wrote:
>     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).

Never in an event handler (the "on"s). Yes in other attributes though. For
example:
	<a href="javascript:doSomething()">clicky button</a>
but really you should use:
	<a onclick="doSomething(); return false" href="">clicky button</a>

The "return false" bit will prevent the page from reloading. The href=""
will (1) validate, (2) some browsers won't show the link if there is no
href attribute.

emma

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]


More information about the thelist mailing list