javascript string replace escape single quote

 

 

 

 

Single quote escape in JavaScript function parameters 7 answers Okay, I am basicallyThe non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping Because the string needs to be escaped (single quotes only), I have written the exact same code in a test function. I have the following bit of pretty simple JavaScript codeThe thing is that.replace()does not modify the string itself, so you should write something like The following example will show you the better way to find and replace a string with another string.