javascript - JSON: why are forward slashes escaped? -


The reason for this is "escape" me.

is avoided by forward slash, so a hash is sorted as {"a"> < Code> {"a": "a \ / b / c"} : "a / b / c"} .

Why?

JSON You do not need to do this, it allows you to do this. It also allows you to use "\ u0061" for "A", but it is not required & lt; Script & gt; \ / permits the \ / while embedding JS in the tag & lt; / , such as SEB points out of the information.

Some ASP.NET Ajax / JSON APIs of Microsoft have used this defense to add additional information, for example, a date time in "\ / date (milliseconds) \ / ". (Yuk)


Comments

Popular posts from this blog

MySql variables and php -

php - Laravel - Overriding a resource route into a different route filter group -

url rewriting - How to implement the returnurl like SO in PHP? -