For my project, the JSON
data is stored in the variable this.responseText
:
{
'nav': '<a href="">a</a><a href="">b</a>',
'content': '<div>tartalom</div>',
'akarmi': 'hello'
}
To efficiently process this data, I plan to utilize a .foreach
loop like so:
document.getElementById("nav").innerHTML = '<a href="">a</a><a href="">b</a>';
document.getElementById("content").innerHTML = '<div>tartalom</div>';
document.getElementById("akarmi").innerHTML = 'hello';