output encoding

Converting data into a safe form for the exact place it is written, such as HTML text or an attribute, so the browser shows it instead of running it.

In more detail

It is the escaping defence applied at the point of output, with rules that depend on whether the value lands in HTML text, an attribute, a URL or a script. Use the encoder that ships with your template engine or language, such as html.escape.

Examples

In the course html.escape turns the script tag into harmless text.
'<p>' + escape(payload) + '</p>'

Related terms

Taught in

References