Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m not defending the usage of `document.write()`, but my understanding of why 3rd party scripts might like using it is to prevent element flicker on load. If you own the site, there are various tricks available to avoid element flashing, but less tools available as a 3rd party. Still, it’s not a good choice, and probably as a 3rd party you shouldn’t be trying to make those design decisions, but I think that is why it’s usage is more common in 3rd party scripts.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: