4 ms·
Agreed. I tried to explore this issue a while back: http://branchandbound.net/blog/web/2012/11/unify-server-side-client-side-rendering-embedding-json/ http://br
by SanderMak 13y ago
Agreed. I tried to explore this issue a while back: http://branchandbound.net/blog/web/2012/11/unify-server-side-client-side-rendering-embedding-json/ http://branchandbound.net/blog/web/2012/11/unify-server-side...
Turns out that using script-tags is somewhat problematic, but as a comment points out, data-attributes could work.
- esailija 13y agoThis is not a problem in e.g. PHP, out of the box it can embed json in script tags, with default settings you never get the sequence `</script>` (you get `<\/script>` instead) and it even escapes U+2028` and U+2029 which are syntax errors in Javascript string literals but not in JSON.