Re:Json ⊄ js
by ricardobeat on Friday December 28, 2012 @12:34AM
(#4976588)
Use data-* attributes [1], or print it in a script tag with a text/anything type:
[1] https://developer.mozilla.org/en-US/docs/HTML/Global_attribu...
[ Parent
| on HN ]
Re:Json ⊄ js
by benmmurphy on Friday December 28, 2012 @07:42AM
(#4977460)
If you put it in a script tag you need to ensure you escape </script>. Though, it is probably safer to escape <, >, and & just to be sure.