Hi,
I can see how to attach an event to an object that has no parameters and no return value but how to modify the code below to attach a listener that takes parameters and returns a value?
function attachEventListener(target, eventType, functionRef,
capture)
{
if (typeof target.addEventListener != "undefined")
{
target.addEventListener(eventType, functionRef, capture);
}
else if (typeof target.attachEvent != "undefined")
{
target.attachEvent("on" + eventType, functionRef);
}
attachEventListener(mylink, "click", ClickMe, false);
I get no error when I do this but it also doesn't fire the event when the link is clicked eithier, Note my functionRef is in this form Test(true, "Hello!"):
target.attachEvent("on" + eventType, function() {functionRef});
Thanks!