如何将字符串转换为我将在 JSNI 中使用的 JSON 对象? 谢谢。
最佳答案
这是一种复制粘贴的方式:
import com.google.gwt.core.client.JsonUtils;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
...
JSONObject data = new JSONObject(JsonUtils.safeEval(jsonString));
JSONArray array = data.get("anArray").isArray();
JSONObject obj = data.get("anObject").isObject();
关于javascript - 在 GWT (JSNI) 中将字符串转换为 JSON 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29408986/