You're probably having problems because the jQuery jQuery.getJSON()
method uses a GET request (the clue's in the method name) to return
JSON data to your javascript, not to POST JSON data to your back-end.
For that, you'd want to use the more generic jQuery.ajax() method,
kinda like this:
var pos
I m not usind json_encode() - After all, I m able to get JSON data
from the controller to my view just fine. The problem is when I make a
JSON request from my view to the controller and pass some parameters.
It's those params that I cannot access..
On Sep 22, 3:14 am, Donkeybob <[EMAIL PROTECTED]
What is your controller code? are you using json_encode in it?
something like this ---> echo json_encode($this->Model-
>find('all'));
On Sep 21, 7:24 pm, jkritikos <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'm having trouble accessing JSON data from a controller. (I'm using
> cake version 1.2
Hi there,
I'm having trouble accessing JSON data from a controller. (I'm using
cake version 1.2). My JSON request is as follows:
$.getJSON(
'/locations/find',
{s1:val1, s2:val2},
function callback(data){
//doStuff
});
I know that the JSON request is made just fine because when I tried it
wit