A way to replace document.write()