Skip to content

Commit

Permalink
Update element.js
Browse files Browse the repository at this point in the history
Attr now doesn't serialize functions (second edition) libxmljs#216
  • Loading branch information
Zig1375 committed Nov 15, 2013
1 parent a574934 commit 71c25b6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/element.js
Expand Up @@ -29,11 +29,9 @@ Element.prototype.attr = function() {
if (typeof arg === 'object') {
// object setter
// iterate keys/value to set attributes
for (var k in arg) {
if (typeof arg[k] != 'function') {
this._attr(k, arg[k]);
}
};
Object.keys(arg).forEach(function(v, k){
this._attr(k, v);
});
return this;
} else if (typeof arg === 'string') {
// getter
Expand Down

0 comments on commit 71c25b6

Please sign in to comment.