Skip to content

Commit

Permalink
ticket #126: add HTMLScriptElement.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
client9 committed Mar 22, 2010
1 parent 7042437 commit e138bd3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/html/script.js
@@ -1,5 +1,5 @@

/**
/**
* HTMLScriptElement - DOM Level 2
*/
HTMLScriptElement = function(ownerDocument) {
Expand All @@ -14,11 +14,11 @@ __extend__(HTMLScriptElement.prototype, {
if (this.childNodes[i].nodeType == Node.CDATA_SECTION_NODE) {
return this.childNodes[i].nodeValue;
}
}
}
// otherwise there will be a text node containing the script
if (this.childNodes[0] && this.childNodes[0].nodeType == Node.TEXT_NODE) {
return this.childNodes[0].nodeValue;
}
}
return this.nodeValue;

},
Expand Down Expand Up @@ -63,6 +63,10 @@ __extend__(HTMLScriptElement.prototype, {
this.setAttribute('type',value);
},
onload: HTMLEvents.prototype.onload,
onerror: HTMLEvents.prototype.onerror
onerror: HTMLEvents.prototype.onerror,
toString: function() {
return '[object HTMLScriptElement]';
}

});

0 comments on commit e138bd3

Please sign in to comment.