MetaScript.js
function escapestr(s) {
            return s.replace(/\\/g, '\\\\')
                    .replace(/'/g, '\\\'')
                    .replace(/"/g, '\\"')
                    .replace(/\r/g, '\\r')
                    .replace(/\n/g, '\\n');
        }
function escapestr(s) {
            return s.replace(/\\/g, '\\\\')
                    .replace(/'/g, '\\\'')
                    .replace(/"/g, '\\"')
                    .replace(/\r/g, '\\r')
                    .replace(/\n/g, '\\n');
        }
function escapestr ( s ) { return s . replace ( / \\ / g , '\\\\' ) . replace ( / ' / g , '\\\'' ) . replace ( / " / g , '\\"' ) . replace ( / \r / g , '\\r' ) . replace ( / \n / g , '\\n' ) ; }
Escaoes a string to be used inside of a single or double quote enclosed JavaScript string.
@function escapestr
@param {string} s String to escape
@returns {string} Escaped string
Escaoes a string to be used inside of a single or double quote enclosed JavaScript string .