Framework

- About
- Guides
- Community
- API
- Code
- Download

# Kanso API Documentation

Index | View on single page

## sanitize

Input sanitization, escaping, and construction functions covering security-sensitive areas.

### escapeHtml(s)

Encodes required characters as HTML entities so a string can be included in a page. This function must be used to avoid Cross-site Scripting attacks.

#### Parameters

s | String |

Returns: String

### escapeJavascriptString(s)

Encodes selected characters in a string, so that the string can be safely used within a Javascript string constant. This function must be used to avoid cross-site scripting attacks (or, in some cases, arbitrary server-side code execution).

#### Parameters

s | String |

Returns: String

### escapeJavascriptString(s)

Encodes selected characters in a string, so that the string can be safely used within an XML character data section. This function must be used to avoid cross-site scripting attacks.

#### Parameters

s | String |

Returns: String

### generateDomIdentifier(s)

Takes any number of arguments, and combines them together to safely form a string that's suitable for use as a DOM element identifier.

#### Parameters

s | String |

Returns: String

### generateDomName(s)

Takes any number of arguments, and combines them together to safely form a string that's suitable for use in a DOM element's name attribute.

#### Parameters

s | String |

Returns: String