Is there any wrong in my code?please help
Can you please share a screenshot of the logs that you are getting on console? Please inspect the webpage and click on the console.
If possible, you could also share the code here. We will look into it and will provide a solution for the error.
Hi @chandachandramahesh ,
Just remove this.readystate == 4 &&
.
Correct code:
httpRequest.onreadystatechange = function() {
if (this.status == 200) {
result = JSON.parse(this.responseText);
document.getElementById("output").innerHTML = result.data[0].temp;
console.log(result.temp);
}
};
Do let me know if you need any other help.
1 Like