View source: R/template-variables.R
| json_for_script | R Documentation |
JSON from jsonlite::toJSON() is a valid JavaScript expression, but a
string in it that contains <!-- followed by <script can stop the HTML
parser from ending the surrounding <script> block at its closing tag. This
writes every < as \u003C, and U+2028 and U+2029 as escape sequences,
so the JSON stays valid and keeps its value. Templates use it for every
JSON value they inline into script code, such as
var apps = {{{apps_json}}}; in launcher.html and the backend config in
main.js.
json_for_script(x)
x |
Value to serialize (with |
A single string of JSON.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.