escape in javascript
function escapeHtml(str) {
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
}function escapeHTML(text) {
var replacements= {"<": "<", ">": ">","&": "&", """: """};
return text.replace(/[<>&"]/g, function(character) {
return replacements[character];
});
}escape sequences in javascript
\' single quote
\" doucle quote
\\ backslash
\n newline
\r carriage return
\t tab
\b backspace
\f form feed"\\n";
Also in JavaScript:
- es6 array sum javascript
- node js callback
- how to generate random string in javascript
- javascript extract date from string
- Exception in thread "main" org.openqa.selenium.JavascriptException:
- javascript jqgrid events afterShowForm
- on success replace class div ajax
- jquery get next element
- js redirect code
- call local function javascript
- d3 paning
- momentjs docs
- in angular how to get router url without query params
- upload file from url javascript
- How to find the max id in an array of objects in JavaScript
- react if statement
- js document.getelementsbyclassname modify innertext
- javascript insertBefore
- node send file
- next js create store
- javascript switch case regex
- js new array from new set
- pdfjs customizing viewer.html js event handler
- makes number negative javascript