Using javascript / another client side scripting language I need to show the result of a http get request, and update every X seconds without refreshing. The api I am working with is external and works like this: You send it a request, no parameters, and it returns a number. I need to display this in a static html site and live update it every 2 seconds.
So far I have been able to live update using functions like Math.random()
and setInterval but my trouble is making a GET request inside the JavaScript, to an external domain. I have a working php script that provides the result but I do not know how to integrate this into the JS