diff options
| author | Tim Graham <timograham@gmail.com> | 2018-06-22 09:36:17 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-06-22 10:35:57 -0400 |
| commit | d5482dfe20cfd4e244db600733d8a5cf58664f2c (patch) | |
| tree | eb7bd6fef6f76d53fafabb30cfd87a61f0d563e2 | |
| parent | c1c1ac20444c25345bb2cb692c7bd8fa09afd250 (diff) | |
[2.1.x] Refs #17419 -- Removed IE8 support in json_script example.
Backport of 02cd16a7a04529c726e5bb5a13d5979119f25c7d from master
| -rw-r--r-- | docs/ref/templates/builtins.txt | 3 |
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>&'}``, the output is: |
