return eval('(' + json + ')');
On Wed, Aug 3, 2011 at 4:43 PM, Alexander Orlov <alexander.orlov@loxal.net> wrote:
The JSONObject takes only JavaScriptObject as its constructor parameter. JavaScriptObject can be returned only by a JSNI function which I wrote:public static native JavaScriptObject parseJson(String jsonStr) /*-{return eval(jsonStr);}-*/;but when I doString json = "{\"userId\" : \"123\", \"sessionId\" : \"456\"}";JavaScriptObject javaScriptObject = parseJson(json);I getERROR: Uncaught exception escaped. com.google.gwt.core.client.JavaScriptException: (SyntaxError): Unexpected token :-Alex--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Z8Uk3YifLLYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment