mirror of
https://github.com/django/django.git
synced 2025-04-06 22:46:41 +00:00
[2.1.x] Refs #17419 -- Removed IE8 support in json_script example.
Backport of 02cd16a7a04529c726e5bb5a13d5979119f25c7d from master
This commit is contained in:
parent
c1c1ac2044
commit
d5482dfe20
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user