Created
June 21, 2009 23:16
-
-
Save steida/133693 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(write, parser, slice, fragment) { | |
document.write = function() { | |
var id = 'document_write' + $time().toString(36); | |
var html = slice.call(arguments).join(''); | |
write.call(document, '<span id="' + id + '"></span>'); | |
window.addEvent('domready', function() { | |
$A(parser.set('html', html).childNodes).filter(document.write.filter).each(function(node) { | |
fragment.appendChild(node); | |
}); | |
$(id).parentNode.replaceChild(fragment, $(id)); | |
}); | |
}; | |
document.write.filter = function(el) { | |
return el; | |
}; | |
})(document.write, new Element('div'), Array.prototype.slice, document.createDocumentFragment()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment