Why are escape characters being added to the value of the hidden input

后端 未结 5 1367
予麋鹿
予麋鹿 2020-12-04 02:32

  
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 03:05

    I believe the problem is just one of escaping done by the tools you are using to output the string. For example:

    var msg = dojo.toJson({field1: 'string', field2: 84, field3: 'another string'});
    alert(msg);
    

    will show the double quotes as unescaped. Similarly, running your first example while the browser is hooked up to a proxy like Charles, shows the double qoutes as unescaped.

    So I believe this is just an auto-escape that Firebug/PHP does when showing you strings.

提交回复
热议问题