OZONE Asylum
Forums
DHTML/Javascript
document.write == "evil"
This page's ID:
31454
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Interesting timing: earlier this week I made myself a wrapper for document.write and document.writeln. See below if you're interested. I've not tried to collect stats or anything but at first glance the use cases are:[ulist]* Google analytics and other stats/tracking tools * building SCRIPT tags pointing to affiliate/ads programs * building IFRAMEs with ads * building OBJECTs with ads in Flash * building NOSCRIPT tags!!! * stupid calendar widgets * adding a A tag with a mailto: address * [/ulist] So far I don't feel like I'm missing much. [code]/** * wrapper for document.write and document.writeln */ (function() { var _buffer = ''; var _timeout = 0; var _emitter = window.opera?opera.postError:window.console?console.log:alert; document.writeln=document.write=function() { // the replace simply adds a \n after each closing tag _buffer += arguments.join('').replace( /(<\/[^>]+>|\/>)/g, '$1\n' ); clearTimeout( _timeout ); _timeout = setTimeout( _dump, 100 ); } function _dump() { if( _buffer!=='' ) { _emitter( 'document.write - '+ location.href +'\n \n'+ _buffer ); _buffer = ''; } } })(); [/code] [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »