I know there are lots of issues with using document.write
and I avoid it absolutely. However, I have run into an issue with a 3rd party widget that is using it. I don't quite know how to put into words (and also probably don't know all the reasons) why this little slice of pure evil should be avoided.
I've already rewritten the code the 3rd party gives to inline their widget so that it doesn't use document.write
. However, that code loads a further script that uses it. I'm delaying the loading of the script which is causing its document.write
calls to happen after onload
, overwriting my entire page.
So the question is, what are all the issues with using document.write
so that I can provide a comprehensive list on why the 3rd party should fix their code?
Thank you in advance!