<html> ... <script> document.write("I replace the content of the page"); </script> </html>
The use of document.write can delay the display of the page by several seconds. Moreover, in some cases (a slow connection for example) chrome blocks its use and makes the page rendering uncertain.
For example, to insert HTML code :
<script> document.getElementById("container").innerHTML = "Properly added HTML content"; </script>
<script> var script = document.createElement('script'); script.src = 'https://cdn.example.com/script.js'; document.head.appendChild(script); </script>
If a third party script uses document.write, contact the supplier to find an alternative solution.