Skip to content

Instantly share code, notes, and snippets.

@davglass
Created October 21, 2010 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davglass/638889 to your computer and use it in GitHub Desktop.
Save davglass/638889 to your computer and use it in GitHub Desktop.
var Document = function() {};
Document.prototype = parser.prototype;
//or
Document.prototype = parser;
Document.prototype.__defineGetter__('body') = function() {
return this.getElementsByTagName('body')[0];
}
var document = new Document();
document.body; //Reference to the BODY element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment