Best way to store JSON in an HTML attribute?
Best way to store JSON in an HTML attribute?
* https://stackoverflow.com/questions/7322682/best-way-to-store-json-in-an-html-attribute
TLDR: data-
attribute, wrapped in single quotes, special characters '
, <
, >
, &
html-escaped.
HTML | |
---|---|