It should have worked fine with the older Cake version too, just as I've described in your other question ;)
Anyways, look at the code in /lib/Cake/View/JsonView.php
or in the API documentation. You have to define a view var named _jsonp
, which can be either a string specifying the name of the query variable that holds the callback function name, or true
which means a default query variable with the name callback
is being looked up.
So as jQuery uses a query variable name of callback
by default, defining true
for _jsonp
should do it:
$this->set(array(
'member' => $members,
'_serialize' => array('member'),
'_jsonp' => true
));
In case no query variable named callback
could be found in the request URL (ie ?callback=whatever
), you'd receive a regular JSON response instead.
See also