summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/templates/builtins.txt3
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index a3e429d1c4..b77b6097e1 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -1814,8 +1814,7 @@ The resulting data can be accessed in JavaScript like this:
.. code-block:: javascript
- var el = document.getElementById('hello-data');
- var value = JSON.parse(el.textContent || el.innerText);
+ var value = JSON.parse(document.getElementById('hello-data').textContent);
XSS attacks are mitigated by escaping the characters "<", ">" and "&". For
example if ``value`` is ``{'hello': 'world</script>&amp;'}``, the output is: