Content deleted Content added
Mike Dillon (talk | contribs) m first argument of "call()" becomes "this", so pass elem as second arg |
Mike Dillon (talk | contribs) m break out single attribute handling into a function |
||
Line 9:
var elem = document.createElement(name);
return elem;
};
var processSingleDomAttribute = function(elem, attrName, attrValue) {
}
};
Line 40 ⟶ 56:
var attrs = args[0];
for (var attrName in attrs) {
▲ // Invoke function callbacks and use their result as the value
▲ if (typeof attrValue == functionType) {
▲ // Pass null for "this"
▲ attrValue = attrValue.call(null, elem);
▲ }
▲ // Skip null values
▲ if (attrValue == null) {
▲ }
▲ // Set the attribute
▲ elem.setAttribute(attrName, attrValue);
}
|