There are thousands of objects and chrome crashes every time I load everything at once.
btn.addEventListener('click', function(){
event.preventDefault();
async function getData(){
const response=await fetch(url)
const data= await response.json();
info(data)
}
getData();
function info(x){
x.messages.forEach(element => {
console.log(element.creator.name+": "+element.text)
// console.log(x.element.text)
con.innerHTML += "<p>"+element.creator.name+": "+element.text+"</p>";
});
}
This is the code im using rn
\`).join('');` will work better since you are trusting innerHTML anyway – mplungjan Jul 02 '23 at 12:40