JSUtil - escapeAttr(String text)

Escape ampersands commonly used to define URL attributes.

Table 1. Parameters
Name Type Description
text String The text
Table 2. Returns
Type Description
String The text with ampersands properly escaped.

var attr = "sysparm_query=active=true&sysparm_view=special";
Output: This is the returned text. If the text is displayed in the application, the page will render the escaped ampersand with a single ampersand.