User:Mike Dillon/Scripts/easydom.js: Difference between revisions

Content deleted Content added
m attempt to make function pointers work for stuff like onclick
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) {
// Use direct object property assignment for "on" attributes
if (attrName.indexOf("on") == 0) {
// Use direct object property assignment for "on" attributes
elem[attrName] = attrValue;
} else { return;
// Invoke the callback otherwise, passing null for "this"
attrValue = attrValue.call(null, elem);
}
 
// Invoke the callback otherwise, passing null for "this"
attrValue = attrValue.call(null, elem);
}