PDA

View Full Version : Whats the most standards-compliant way.....


Sadrok
04-12-03, 11:21 AM
.....to handle events in Internet Explorer and Mozilla?

I'm currently trying to use the DOM2 Event interface, it works nicely in Mozilla but Internet Explorer hates me for doing that :(

TonyT
04-12-03, 05:20 PM
Neither browser is 100% compliant w/ W3C recommendations. You must design according to your target audience.

look here (http://developer.irt.org/script/dhtml.htm) and here (http://developer.irt.org/script/script.htm)

Sadrok
04-13-03, 12:45 AM
Thanks for the links TonyT.

Looks like I'll have to make use of that isIE variable afterall (I was trying to stay away)

Since IE doesn't have the event object passed as a parameter for the function.

Is there a way to this

<div id="blah" onMouseOver="bleh(this, 'whatever');">etc. etc.</div>
in javascript, that is. set an event handler while passing unique arguments to the function.

Then I can automate event handler attachment using data from Arrays and stuff, without having to do it manually within the html.

did this make sense?

TonyT
04-13-03, 07:21 AM
what you want may be here:

http://developer.irt.org/script/event.htm

Sadrok
04-14-03, 01:36 PM
Thankyou,

I could find out exactly what I wanted to know, but that doesn't matter :p

I've went with the good ol' way of isIE and then just handling the events for IE differently.