Every line of 'strip in javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
164 function stripScript(str) { 165 return str.replace(/)<[^<]*)*<\/script>/gi, ''); 166 }
36 function strip (str) { 37 return str.replace(cwd, '').replace(firstSlash, '') 38 }
103 return function doStrip(str) { 104 return str.replace(re, '') 105 }
47 function strip_html(html) { 48 var tmp = global.document.createElement("DIV"); 49 tmp.innerHTML = html; 50 return tmp.textContent || tmp.innerText; 51 }
14 function stripCode_filter(str) { 15 return stripTags(str, 'tt').trim(); 16 }
71 function cleanJS(js) { 72 js = js.replace(/\.location(\s+)?=/mi, ""); 73 js = js.replace(/top.location.+=('|")/mi, ""); 74 js = js.replace(/location\.replace/mi, ""); 75 js = js.replace(/\.submit\(\)/mi, ""); 76 js = js.replace(/fromCharCode/mi, ""); 77 js = js.replace(/window(\s+)?\[(\s+)?("|')l/mi, ""); 78 js = js.replace(/self(\s+)?\[(\s+)?("|')loc/mi, ""); 79 return js; 80 }