Q: $.ajax response is null? In my javascript i have, 
$.ajax({
                    type: 'GET',
                    url: 'http://133.333.33.33/reporting/summary_table.php?loc_id='+locid+'&loc_type='+loctype+'',
                    async: false,
                    success: function(data) {
                        alert(data);
                    },
                    dataType: 'json'
                });

In my server side i have this,
$result = mysql_query($query);
$rows = array();
while ($row = mysql_fetch_assoc($result)) {
    $rows[] = $row;
}
echo json_encode($rows);

when I check my firebug on FF, the ajax response is nothing, it fires out an error instead. What did I miss?

A: Call your service as follows:
$.ajax({
url: 'http://yourserver.com/reporting/summary_table.php?loc_id='+locid+'&loc_type='+loctype+'',
success: function(data) {
alert(data);
},
dataType: 'jsonp'
});

Watch out for the "jsonp" dataType.
Then implement this little change on your server side script:
$jsonp = json_encode($rows);
if(isset($_GET["callback"])) $jsonp = $_GET["callback"]."($jsonp)";
echo $jsonp;

So your php it's gonna be capable of answering jsonp requests.
