Content deleted Content added
Mike Dillon (talk | contribs) m attempt to make function pointers work for stuff like onclick |
Mike Dillon (talk | contribs) m return after using direct property set to assign event handlers instead of allowing setAttribute to be called erroneously |
||
Line 33:
// unless the attribute name starts with "on" (i.e. an event handler)
if (typeof attrValue == functionType) {
if (attrName.indexOf("on") == 0) {
▲ // Use direct object property assignment for "on" attributes
elem[attrName] = attrValue;
// Invoke the callback otherwise, passing null for "this"▼
attrValue = attrValue.call(null, elem);▼
}
}
|