Support element attributes as intended
This commit is contained in:
parent
f04fb92ea4
commit
0273f2557e
|
@ -61,7 +61,13 @@ DOMFragment.prototype.interpretSpec = function (spec) {
|
|||
var attrs = hasAttrs ? spec[1] : {};
|
||||
var kidIndex = hasAttrs ? 2 : 1;
|
||||
|
||||
// Wow! Such XSS! Many hacks! So vulnerability! Amaze!
|
||||
var n = document.createElement(tagName);
|
||||
for (var attr in attrs) {
|
||||
if (attrs.hasOwnProperty(attr)) {
|
||||
n.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
for (var i = kidIndex; i < spec.length; i++) {
|
||||
n.appendChild(this.interpretSpec(spec[i]));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ $(document).ready(function () {
|
|||
}
|
||||
}
|
||||
}, [pub(["DOM", "#clicker-holder", "clicker",
|
||||
["button", "Click me!"]]),
|
||||
["button", ["span", {"style": "font-style: italic"}, "Click me!"]]]),
|
||||
pub("bump_count"),
|
||||
sub(["jQuery", "button.clicker", "click", __])]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue