• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Fetch request to render html


New Coder
I am using a fetch request to trigger a 'view' function in bakend.

However, response of 'fetch' is not rendering correct html. Can someone help,please?

[CODE lang="javascript" title="fetch request" highlight="8"]document.getElementById("postCreaterProfile").style.display = 'block';
document.getElementById('userName').style.display = 'none';
document.getElementById('PostCreaterName').style.display = 'block';
document.getElementById('PostCreaterName').innerText = postCreater;
post_creater = postCreater

fetch('/posts/' + post_creater)
.then(response => response.status)
.then(posts => {