convert string into json object in javascript code example
Example 1: convert json string to json object in java
try {
JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}");
}catch (JSONException err){
Log.d("Error", err.toString());
}
Example 2: js string to json
var obj = JSON.parse("{no:'u',my:'sql'}");//returnes {no:'u',my:'sql'}