knowledge-database (beta)

Current group: opera.page-authoring

From:Lee Atkinson
Subject:
....

Will Opera ignore the for and event arguments and therefore run the code
when it parses the HTML, or will it ignore the block completely?

At the moment, my tests show that the code is being run on parsing - i
would prefer for the code not to run. The way to code around this for
other non-IE browsers is to specify the type to be "text/jscript", but
since Opera supports JScript, this does not work. Any suggestions? I
guess I could test to see if the argument in the event attribute
'anargument' is defined in the code?

Regards Lee


Rijk van Geijtenbeek wrote:
> On Thu, 02 Dec 2004 09:59:22 +0000, Lee Atkinson wrote:
>
>> Hi - does Opera support the use of 'for' and 'event' attributes on a
>> script tag so that it only executes the contained script when the
>> specified event is raised?
>
>
> No, this is an MSIE-only extension. See also
> http://www.htmlcodetutorial.com/scripts/_SCRIPT_FOR.html
> for a cross-browser solution.
>
From:Paul McGarry
Subject:Re:
=====

Do you know how khtml/Safari treats the code?

Paul
-- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
From:Lee Atkinson
Subject:Re:
> =====
>
> Do you know how khtml/Safari treats the code?
>
> Paul
> -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
From:Rijk van Geijtenbeek
Subject:Re:
> ...
>
> Will Opera ignore the for and event arguments and therefore run the code
> when it parses the HTML, or will it ignore the block completely?
>
> At the moment, my tests show that the code is being run on parsing -

OK, so you did test :)

> i would prefer for the code not to run. The way to code around this for
> other non-IE browsers is to specify the type to be "text/jscript", but
> since Opera supports JScript, this does not work. Any suggestions? I
> guess I could test to see if the argument in the event attribute
> 'anargument' is defined in the code?

I'm not a JavaScript wizard, sorry. Maybe include this script inside a
conditional comment?

--
Rijk van Geijtenbeek

Opera Software ASA
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
   

Copyright © 2006 knowledge-database   -   All rights reserved