Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 477 Bytes

filter_escapejs.rst

File metadata and controls

19 lines (12 loc) · 477 Bytes

django

Escapes the value for insertion in Javascript output.

For example:

{{ value|escapejs }}

When the value is he'llo then the output is he\x27llo.

Internally, this calls z_utils:js_escape/1 to perform the escaping.

Note: when generating JSON output, be sure to use filter-escapejson, as JSON escaping is subtly different from JS escaping.

filter-escape, filter-escapejson