addEventListener function in IE

M

Michael Hill

I received an error on the addEventListener line in this function.

function load()
{
el = document.getElementById("t");
el.addEventListener("click", l_func, false);
}

I am using IE 6.0.

Does IE use something else?

Mike
 
M

Martin Honnen

Michael said:
I received an error on the addEventListener line in this function.

function load()
{
el = document.getElementById("t");
el.addEventListener("click", l_func, false);
}

I am using IE 6.0.

Does IE use something else?

There is no current IE version supporting addEventListener which is a
method defined in the W3C DOM Level 2 Events module which IE doesn't
support.
IE 5.5 and IE 6 on Windows support
el.attachEvent('onclick', l_func)
so the difference is that you need to use 'oneventname' as the first
argument instead of 'eventname' and that there is only a second argument
, the function. The event model in IE only supports event bubbling so
there is no third argument.
 
M

Michael Hill

Martin,

Yes that works ... just one thing though.

How do you then stop event propagation or the bubbling from going up
through the heirarchy?

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top