it prints [object Object], [object Object] and you need all its information

this json

[ { "Name": "vasya", "lastName": "vasev", }, { "Name": "micha", "lastName": "misckin", }, ] 

 var button = document.querySelector('.load'); var text = document.querySelector('.text'); button.addEventListener('click', function(e){ e.preventDefault(); fetch('01.json') .then(function(data){ return data.json(); }) .then(function(data){ let {}= data; text.innerHTML += data; console.log(data); }) }) 
 <button class="load">загрузить данные</button> <p class="text"></p> 

    1 answer 1

     text.innerHTML += JSON.stringify(data); 
    • thanks, if not difficult as also add in .json - Starbax
    • @Starbax I did not understand the question. - Igor