Hi all,
I am using cakePHP 1.26.
I was trying to use JQuery AJAX to pass some sample data to a function in a Controller,
but failed to do it.
This is the JQuery Part:
var w="helloworld";
var curl="http://localhost:8080/test/grab/";
$.ajax({
type: "POST",
url: curl,
data: "testing="+w,
success: function(data) {
alert(data);}
});
And this is the Function in the Controller:
function grab(){
$g=$this->data['testing'];
return $g;
}
But the Alert msg box did not show me anything but blank message.
Please help if you could.