Hi,

> I there a documentation to this function? I would like to read something like
> this:
> "isJSON does not accept \n chars and @ chars in a string."

The docs say what it does: It checks to see if the string is in valid
JSON notation. To know what valid JSON notation is, please (again)
refer to the link I've given you.

For example: Why does isJSON disallow newlines inside JSON strings?
Because http://JSON.org tells us that a JSON string may contain
"...any-Unicode-character-except-"-or-\-or-control-character" and
newline is a control character.

So if you want to know what isJSON is going to consider valid, refer
to the definition of JSON, which is at http://JSON.org.

-- T.J.

On Nov 11, 4:01 pm, Manfred Rebentisch <mrebenti...@comparat.de>
wrote:
> Hi
> ok, please read, what I mean. My code actually runs perfectly.
> In the past I have had problems with the newline and found, that isJSON()
> checks the string coming from server. Thats fine.
>
> I only want, that I did not run into new problems later, and want to
> understand, what isJSON() does. So I do not understand the regular expression
> until now:
>
>     str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
>
>     return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
>
> I there a documentation to this function? I would like to read something like
> this:
> "isJSON does not accept \n chars and @ chars in a string."
>
> It is for security and that is fine. But it is not fine, if my customer find a
> problem later.
>
> Thank you in advance
>
> Manfred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to