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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -