Answer the question
In order to leave comments, you need to log in
Is there any generic way to iterate over JSON and write to DOM?
I have JSON like this:
{
title: "Grocery",
food: ["apple", "banana", "cucumber"]
}
{
title: "Grocery",
food: [
{
fruit: "Apple",
vegetable: "Cucumber"
}
{
fruits: { "Banana", "Chery" },
vegetable: "Tomato",
other: "Cheese"
}
]
}
Answer the question
In order to leave comments, you need to log in
There can be no universal way in principle. You bring JSON to a single structure, and then write a template engine.
By the way, I recently wrote a randomizer here. See if it comes in handy.
Excuse me, are you kidding me?
https://facebook.github.io/react/
www.ractivejs.org
https://vuejs.org/examples/
https://github.com/Lucifier129/react-lite
https://mustache.github.io/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question