I am trying to fetch data from JSON and then append it to the HTML body.
Unfortunately, I manage to only fetch the object like so:
fetch( 'https://www.url.com/getdata/showid?userId=433642', {
method: 'get'
}).then( function( response ) {
return response.json();
}).catch( function( err ) {
// Error
});
The JSON data looks like so:
{"id":"542434","formattedId":"66-44-3224-23"}
What is the best way to append the JSON response to the page body?