1 min read


Prevent unsafe usage of document.write() in your application.
Table of Contents

Conformance is available on Enterprise plans

Calls to document.write() or document.writeln() manipulate DOM directly without any sanitization and should be avoided.

Furthermore, these APIs can also cause performance issues and trigger will clear the page contents if used after page load.

Avoid usage of document.write() entirely in your application, and instead either use UI framework like React to handle writing to the document, or use safer DOM APIs, such as document.createElement() instead.

Last updated on June 17, 2024