Problem with ajax functions callback and json

Problem with ajax functions callback and json

I have strange behaviour on ajax callback functions, lately I had a similar problem about which I posted which mysterioulsy went away, it just started working.
Now I am trying to get something done and have the same issue again.
I have this php function getdeck.php which returns an array:

  1. getdeck.php:
    <?
    $name = $_GET['name'];
    echo file($name);
    ?>



Now if I do:

  1. $.get('getdeck.php', { name: 'Celtic' }, function(data)
      {
      alert('hi world');
      });


I get the alert, but if I try the json datatype:

  1. $.get('getdeck.php', { name: 'Celtic' },  dataType: 'json', function(data)
      {
      alert('hi world');
      });


I don't get an alert and the rest of the script doesn't execute anymore.

I tried some variations:

  1. $.getJSON("getdeck.php?name=Celtic", function(data) {
      alert('hi');
    });

I get no alert() but the rest of the script executes.

  1. $.ajax( {  url: "getdeck.php?name=Celtic", dataType: "json", success: function(data)  {
      alert('hi');
      }
     });


Same as the above one.
  
I'm somewhat baffled at the moment, I had the problem before on another project and then 'it just went away' (tm).
Somebody any idea what's going on here?