Answer the question
In order to leave comments, you need to log in
Unable to output text from JSON to HTML. How can I do it?
I have code
$.getJSON( "json/account.json", function(obj) {
$.each(obj, function(key, value) {
document.getElementById('nickname-menu').innerHTML = value.Name;
});
});
{
"Name": "Happy",
"Title": "The Just Dancer",
"Avatar": "1",
"Skin": "11"
}
Answer the question
In order to leave comments, you need to log in
why are you iterating over your json?
$.getJSON( "json/account.json", function(obj) {
document.getElementById('nickname-menu').innerHTML = obj.Name;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question