Answer the question
In order to leave comments, you need to log in
JSONObject changes dynamically, how to get around it?
JSONObject userInfo = jsonresponce.getJSONObject("ChampionLA54");
brsndP = userInfo.getString("brand");
artP = userInfo.getString("number");
nalP = userInfo.getString("availability");
desP = userInfo.getString("description");
} catch (JSONException e) {
e.printStackTrace();
}
but the variable "ChampionLA54" changes dynamically, how to parse the response bypassing "ChampionLA54", "GOTTWALDLA54", "Mahle/KnechtLA54"?
Answer the question
In order to leave comments, you need to log in
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
console.log(obj[key]); // print all object items
};
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question