Not showing temperature

Is there any wrong in my code?please help

Hi @chandachandramahesh,

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.

@chandachandramahesh I am looking into this and will get back to you shortly.

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 =[0].temp;

Do let me know if you need any other help.

1 Like