This is my PHP page (on a different URL)...
<?php
header('Content-Type: application/json');
?>
stat({"online":1});
And this is my jQuery:
$(document).ready(function(){
var url = 'http://blah.com/jsontest.php?callback=stat';
$.getJSON(url, function(data) {
if (data.online !== undefined) {
console.log('yay');
}
}).error(function() {
console.log('no');
});
});
For some reason it is always logging 'no' i.e. its running the error function.
Using jQuery 1.5.2 any ideas?