Javascript String safe()

Description

Javascript String safe()

String.prototype.safe = function() {
    // safe string for html
    return this.replace(/\"/g, "&quot;").replace(/\'/g, "&#39;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
}



PreviousNext

Related