diasporg/Poduptime — pull request #5 by arlogn (2013-08-01 18:40:42+00:00)
Title: Cross-domain communication with JSONP

Enable cors for all domains isn't a good practice. Maybe in this case is better using jsonp. I added a new param to get response with this method.
The list can be obtained via jquery:
$.ajax({
type: 'GET',
url: 'http://podupti.me/api.php,
dataType: 'jsonp',
data: {key:'4r45tg', format:'json', method:'jsonp'},
jsonpCallback: 'successCallback'
});

or appending a script element to the dom:
var poduptime = "http://podupti.me/api.php?key=4r45tg&format=json&method=jsonp&callback=successCallback";
var script = document.createElement("script");
script.src = poduptime;
document.body.appendChild(script);