I know this has been discussed earlier, but I am not sure how to use
JSONP for cross domain communication correctly. This is how I make the
request:
var jqxhr = $.getJSON('get_devices.jsonp', function(data) {
displayList(data);
})
.error(function() { alert("error"); })
I have tried the following URLs:
1. get_devices.json (works on local, fails on remote)
2. get_devices.jsonp (fails on local and remote)
3. get_devices.jsonp?callback=? (works on local, fails on remote)
And my controller simply does the following:
def get_devices():
devices = []
rows=db().select(db.device_status.hostname)
for eachrow in rows:
devices.append(eachrow.hostname)
return dict(devices=devices)