1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #17419 -- Removed IE8 support in json_script example.

This commit is contained in:
Tim Graham 2018-06-22 09:36:17 -04:00
parent 9af83a62e7
commit 02cd16a7a0

View File

@ -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: