Skip to content
Advertisement

HTML content displayed as pure string instead of getting rendered as a website

Hello I am getting started with implementing APIs in my project to build a Weather reporting project.This is my .js script.

JavaScript

Now I get the response of the post request as

JavaScript

this is as a string but i want it yo render it like a website.

Instead, when I do respond in this order the html is rendered just fine.

JavaScript

can you explain the reason behind it??

Advertisement

Answer

Issue with this line,

JavaScript

image tag in html has qoutes around src link. You html passing the src without qoutes. you can use single and double qoutes here.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement