Web Tools #555 - CSS/HTML Tools, Git/CLI, ChatGPT
source link: https://mailchi.mp/webtoolsweekly/web-tools-555
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CSS/HTML Tools, Git/CLI, ChatGPT
|
Issue #555 • March 7, 2024
Advertisement
|
From Brewing AI Beers to Brewing Big Ideas At AE Studio, we've done some crazy things. One time, we taught AI to brew beer, and then market it — it sold out. We want to help you build crazy things, too. But first, you need a crazy idea. Our AI Ideas Generator takes your business problem and gives you a report of AI-powered solutions that can help you address it. |
The Element.innerHTML property is as old as time, and most of you who have been coding JavaScript for a while have likely used it. Nowadays, the property is discouraged due to security concerns. For example, MDN states the following regarding using innerHTML to replace content: This is a security risk if the string to be inserted might contain potentially malicious content. When inserting user-supplied data you should always consider using Element.setHTML() instead, in order to sanitize the content before it is inserted.
The problem with this advice is that the setHTML() method is not currently supported by most modern browsers. According to the browser compatibility chart data, it had support in previous versions of Chromium browsers and others but support was dropped.
I've aliased the document.documentElement object to abbreviate the code a bit but that's the gist of the little script. Try it on CodePen here. |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK