Search the web
Sign In
New User? Sign Up
json · JSON JavaScript Object Notation
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
"\/" escape sequence?   Message List  
Reply | Forward Message #249 of 1409 |
Re: "\/" escape sequence?

--- 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.







Sat Feb 4, 2006 10:37 pm

douglascrock...
Online Now Online Now
Send Email Send Email

Forward
Message #249 of 1409 |
Expand Messages Author Sort by Date

Hi all, The language description at http://www.crockford.com/JSON/ says that "\/" is a valid escape sequence. The examples on Yahoo's page here: ...
Blake Seely
blakeseely_99
Offline Send Email
Feb 4, 2006
5:27 pm

... "\/" 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...
Douglas Crockford
douglascrock...
Online Now Send Email
Feb 4, 2006
10:37 pm

Excellent. Thanks for the info Douglas. ... [Non-text portions of this message have been removed]...
Blake Seely
blakeseely_99
Offline Send Email
Feb 5, 2006
12:08 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help