flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject [FlexJS] Use of innerHTML
Date Tue, 27 Jun 2017 16:58:55 GMT
There’s a number of components which use innerHTML for setting text values. (ImageAndTextButton,
Label, StringItemRenderer, TextButton)

I just came across an article which advises against doing so.[1]

Does anyone have a reason to not use append[2] and/or Node.textContent[3] and appendChild[4]?

Harbs

[1]https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations
<https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations>
[2]https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append <https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append>
[3]https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent <https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent>
[4]https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild <https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message