--- In json@yahoogroups.com, Blake Seely <blakeseely@...> wrote:
> The language description at http://www.crockford.com/JSON/ says that
> "\/" is a valid escape sequence.
"\/" is a valid escape sequence. However, it is not required that / be
escaped. You may escape it if you need to. The reason JSON explicitly
allows escaping of slash is because HTML does not allow a string in a
<script> to contain "...</...". JSON allows "...<\/..." which makes
HTML happy. If you don't need to escape the slash, then don't. It is
not required.
> The examples on Yahoo's page here:
>
> http://developer.yahoo.net/common/json.html
>
> show this as a valid escape sequence as well - and all URLs in their
> example use go from "http://blahblah.com/blah/blah" to "http:\/\/
> blahblah.com\/blah\/blah".
I asked them to correct that a couple of weeks ago. Even worse, there
is a syntax error in it.
> However, all the examples at json.org at this url:
>
> http://www.crockford.com/JSON/example.html
>
> do NOT insert use it - URLS and unix paths all just use a bare '/'
> character without first escaping it with '\'. And the sample Java
> code at json.org here:
>
> http://www.crockford.com/JSON/java/org/json/JSONTokener.java
>
> do NOT scan for or handle this escape.
Again, that is because it is not required. Escaping a slash or not
escaping a slash will have the same result.