I have a question to this prototype function:

  function isJSON() {
    var str = this;
    if (str.blank()) return false;
    str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
    return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
  }

If I send a JSON { 'str': '<p>This is a line with \n linefeed</p>' } I do get 
an error. The same is, if the JSON is encoded to { 'str': '<p>This is a line 
with %0A linefeed</p>' }.
I need to delete the linefeed or I need to replace to '<br />'.

I do not understand the regular expression above, because I want avoid to use 
other chars, which results in errors.

Manfred

-- 
http://www.comparat.de
http://www.athesios.de
http://twitter.com/COMPARAT

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