-1
Friends, I have the following JSON:
{
"codigo": "12345",
"cerca": "Rato",
"host": "df",
"eventos": [
{
"data": "21\/02\/2020",
"hora": "19:38",
"local": "Moema\/SP",
"status": "Morto",
"subTim": [
"Um dia sem PC"
]
},
{
"data": "21\/02\/2020",
"hora": "18:29",
"local": "Tatuapé\/SP",
"status": "Meio vivo",
"subTim": [
"Quatro dias sem PC"
]
},
{
"data": "21\/02\/2020",
"hora": "18:09",
"local": "Anápolis\/GO",
"status": "Só tonto",
"subTim": [
"Dois dias sem PC"
]
}
]}
I can correctly load some JSON data into the form as well with JS:
jQuery("#codigo").val(resposta.codigo);
jQuery("#cerca").val(resposta.cerca);
jQuery("#host").val(resposta.host);
What is the correct jquery way to list "events", with "date", "status" and "subTim" in a #registered div in the form ? Example:
Occurrences: My code: 12345 / Fence: Mouse / Host: df
Event1: 21/02/2020 19:38 / Status: Dead / Subtim: A day without PC
Event2: 21/02/2020 18:29 / Status: Half alive / Subtle: Four days without PC
Event3: 21/02/2020 18:09 / Status: Only dizzy / Subtim: Two days without PC
Thank you so much for your attention
It worked perfectly Gambi, my last question about: How does it look instead of Let json, to load this same json data from an external url? Let url = "https://.... ? the remote url response structure is the same.
– Ana Cavalcante
@Anacavalcante , I could not answer before, because I was blocked by the absurd reason of vote manipulation. But you have already solved your problem ? You can do this your situation with Ajax.
– Gato de Schrödinger
Gave straight @Gambi, your response was of great help. Thank you.
– Ana Cavalcante