Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGlynis DeMone
978 PointsVM390:1 Uncaught TypeError: Failed to execute 'write' on 'Document': This document requires 'TrustedHTML' assignment.
I am getting this error when I try to run document.write in chrome. I do not get the error if I use safari on a Mac, but it also doesn't seem to be doing anything.
1 Answer
Travis Alstrand
Treehouse Project ReviewerThis sounds like an issue regarding a newer security feature named Trusted Types. It's possible Chrome handles them differently from other browsers. Are you seeing this document.write
used in a video here on Treehouse? If so, please drop the link so I can take a look 👍
I would try to avoid this method and manipulate the DOM with methods / properties such as textContent, innerHTML & insertAdjacentHTML etc..