Return to Snippet

Revision: 18257
at September 24, 2009 14:58 by remotezygote


Updated Code
getDocument: function() {
					return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName('div')[0]));
				},

Revision: 18256
at September 24, 2009 14:55 by remotezygote


Initial Code
getDocument: function() {
					return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName('div')[0]));
				},

Initial URL


Initial Description
This will get the document's body in a very agreeable manner - it returns the first div on the page if there is no body (hey it can happen).

Adapted from code by Scott Schiller

Initial Title
Bomb-proof document retreiver

Initial Tags
javascript, textmate

Initial Language
JavaScript