エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント5件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Safe DOM manipulation with the Sanitizer API | Articles | web.dev
const user_input = `<em>hello world</em><img src="" onerror=alert(0)>` $div.innerHTML = user_inpu... const user_input = `<em>hello world</em><img src="" onerror=alert(0)>` $div.innerHTML = user_input If you escape HTML special characters in the input string or expand it using .textContent, alert(0) isn't executed. However, since <em> added by the user is also expanded as a string as it is, this method cannot be used in order to keep the text decoration in HTML. The best thing to do here is not es







2021/10/09 リンク