If you’re ever using jQuery without a proper DOM, you may want to use this. It provides enough of a DOM-like syntax to suffice. (Literally, this is every function which jQuery calls on the DOM directly (assuming no selectors). I really wish they abstracted the AJAX functionality so that it would be trivial to use it without the whole framework)
var emptyFunction = function(){ return ""; }, gebi = function(elm){ return { nodeType: '', innerHTML: '', insertBefore: emptyFunction, removeChild: emptyFunction, appendChild: emptyFunction, getAttribute: emptyFunction, setAttribute: emptyFunction, getElementsByTagName: function(){ return {}; }, style: {} }; } window = { document:{ getElementById: gebi, createComment: emptyFunction, createElement: gebi, createDocumentFragment: gebi, documentElement: ntx.extend( { createElement: gebi, childNodes:(function(){ var g = gebi(); return [g] })() }, gebi() ) }, location: { href:"" }, navigator:{ userAgent: "" } };