javascript – How to use Get request and post to <p> element-ThrowExceptions

Exception or error:

I want to use a get request to obtain one digit number from an external URL, subtract 1 from the response and post it into a paragraph <p>. And also I want to use setInterval() to refresh the status of this element.

Can someone please help me figure this out?

The URL I request the digit from is
http://loadshedding.eskom.co.za/LoadShedding/GetStatus

This returns 1 digit.

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *