Hi!
I have an jQuery JSON request, that loads some JSON from another server (ex. foo.com):
$.getJSON("http://foo.com/json.php",function(data) { alert(data); });
But I receive data as null. This is not cross-domain issue, I tried following:
$.getJSON("http://twitter.com/users/usejquery.json?callback=?",
function(data) { alert(data); });
and received nice JSON object. So, I think there is problem with backend, Apache 2.2.14. Here are HTTP headers, sent from server:
Date: Sun, 07 Mar 2010 16:08:38 GMT
Server: Apache/2.2.14 (CentOS)
X-Powered-By: PHP/5.3.1
Content-Length: 2
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: application/json; charset=UTF-8
The headers are the same in each case: regular HTTP-request or AJAX. But I receive empty content with AJAX, and normal JSON with browser request. I'm using Firebug for tests, PHP5 for forming JSON.
Somebody have any ideas? Thank you!