[Javascript] link onclick=location.href not working

Peter Brunone peter at brunone.com
Tue Mar 30 10:48:52 CST 2004


>Will that even work if you add the javascript: before it? You only use
>javascript: if you're putting it in the href, not on a built-in javascript
>event handler.

   That's what I thought.  Although IE will tolerate the javascript: pseudoprotocol designator in event handlers, I don't think it's *supposed* to work that way (and it probably doesn't work that way in Moz and company).

Peter

Original Message:
>From: "Chris T" <christ at saeweb.com>

>>    Just one small comment on David's treatise:
>>
>> >A real hard-core standards type would suggest prefacing the javascript
>> >directive reassigning the window.location.href with "javascript:", but
>I'm
>> >not him.
>>
>>    Wouldn't that hard-core standards type be incorrect?  A protocol or
>pseudoprotocol may be necessary (by standards) for the href property, but I
>didn't think that applied to event handlers.
>
>Will that even work if you add the javascript: before it? You only use
>javascript: if you're putting it in the href, not on a built-in javascript
>event handler.
>
>Chris Tifer





More information about the Javascript mailing list