Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$
by makingstuffs on Thursday October 03, 2024 @02:06AM
(#41727753)
Would you not just be able to do the following:
Edit, figured I'd add the docs: https://developer.mozilla.org/en-US/docs/Web/API/Element/ins...
[ Parent
| on HN ]
Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$
by TimTheTinker on Thursday October 03, 2024 @09:01AM
(#41730398)
That's certainly better than innerHTML, but it has the same security implications as setting innerHTML.
From the MDN page:
> When inserting HTML into a page by using insertAdjacentHTML(), be careful not to use user input that hasn't been escaped.