I am trying to figure out how to make periodic AJAX calls to a cross-domain hostname. For example, how can I serve content from example.com
and make an AJAX call to example.org
every 30 seconds.
The canonical solution to this question is a JSONP call in a <script>
tag. However, the <script>
tag is just loaded once. Therefore, it can not generate periodic calls to another server - just a single call when the page loads.
Is there a way to make a periodic AJAX call to a cross-domain server?