http://locutus.io/php/strings/addslashes/
function addslashes( str ) {
return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
}
More Related Contents:
- Escaping HTML strings with jQuery
- How can I use backslashes (\) in a string?
- Escape quotes in JavaScript
- Regex to match all instances not inside quotes
- How to escape JavaScript in JSP?
- Escaping backslash in string – javascript
- Making a javascript string sql friendly
- How can I insert new line/carriage returns into an element.textContent?
- How do I escape a string inside JavaScript code inside an onClick handler?
- Javascript – Replacing the escape character in a string literal
- How do I make the first letter of a string uppercase in JavaScript?
- Why do backslashes appear twice?
- How do I replace a character at a particular index in JavaScript?
- Trim string in JavaScript?
- How to count string occurrence in string?
- How to find if an array contains a specific string in JavaScript/jQuery?
- Check for special characters in string
- Use dynamic (variable) string as regex pattern in JavaScript
- Convert JavaScript String to be all lower case
- Efficient Javascript String Replacement
- Get the first integers in a string with JavaScript
- Javascript string comparison fails when comparing unicode characters
- Find the characters in a string which are not duplicated
- jQuery call function from a string [duplicate]
- HEX to Base64 converter for JavaScript
- Are ES6 template literals faster than string concatenation?
- How Can I Truncate A String In jQuery?
- How to test if a URL string is absolute or relative?
- Escaping HTML entities in JavaScript string literals within the block
- Does jQuery strip some html elements from a string when using .html()?