Why hangs the browser while processing the code?

seccsessExit function(data){

 var output="";
 var adresssUsers="";
 var geoUsers="";
 for (var i in data) {
output+="<li>";
 for (var j in data[i]) {
 while(j == "address") {
 for(var t in data[i][j]) {
 adresssUsers+= "<p>" + data[i][j][t] + "</p>";
}
output+=adresssUsers;
 while (t=="geo"){
 for(var z in data[i][j][t]) {
 geoUsers+="<p>" + data[i][j][t][z] + "</p>";
}
}
output+=geoUsers;
break;
}
 output+="<p>" + data[i][j] + "</p>";
}
output+="</li>";
document.getElementById("user-contacts").innerHTML=output;
}
}


There is a JSON file, trying to get the array data using AJAX.

All working well and almost without delay, if you do not include this piece of code
while (t=="geo"){
 for(var z in data[i][j][t]) {
 geoUsers+="<p>" + data[i][j][t][z] + "</p>";
}
}


How is it possible to write easier?
March 19th 20 at 09:15
1 answer
March 19th 20 at 09:17
you have to while(j == "address") {
should hang, if not break.
Why do you there a while? while is a loop which will run infinitely until a condition changes, you have t or j must change inside the while loop to work and stopped.
Or are you going to change while to if or something is wrong in principle.

Find more questions by tags JavaScriptAJAX