html - Double quote escaping with Javascript function -


json.stringify escapes double quotes. there input such following code (without modification) not result in escape of double quotes?

<script> function test(s) { document.write(json.stringify(s)); } </script>     <form action="" method="post" onsubmit="test(this.cmd.value); return false;">   <input class="command" type="text" id="cmdbox" name="cmd" />   </form> 

example input/output:

"test" 

expected:

"test" 

actual:

\"test\" 

use unescape escaped string expected result.

unescape(json.stringify(data)) 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -