JSON parser improved. Fixed problem with parsing special symbols

This commit is contained in:
Dima Malishev 2011-08-21 20:59:04 +03:00
parent c80f12eaa4
commit b472a367d5
6 changed files with 107 additions and 11 deletions

View file

@ -123,14 +123,17 @@ App.Helpers.getFirstValue = function(obj)
return first;
}
App.Helpers.evalJSON = function(string)
App.Helpers.evalJSON = function(str)
{
return $.parseJSON(string);
/*str = str.replace(/\\'/gi, '');
str = str.replace(/\'/gi, '');
fb.warn(str);*/
return $.parseJSON(str);
}
App.Helpers.toJSON = function(object)
{
return ($.toJSON(object).replace(/'/gi, ''));
{
return ($.toJSON(object).replace(/\\'/gi, ''));
}