I know that there are many problems using document.write , and I avoid this absolutely. However, I had a problem with third-party widgets that use it. I don’t quite know how to put it in words (and also probably don’t know all the reasons) why this little piece of pure evil should be avoided.
I have already rewritten the code that the third party provides to the embedded widget so that it does not use document.write . However, this code loads another script that uses it. I am delaying the loading of a script that calls document.write calls after onload , rewriting my entire page.
So the question is, what are all the problems with using document.write , so that I can provide an exhaustive list of reasons why a third party should correct their code?
Thank you in advance!
source share