We can implement jquery ajax by this way
$this->layout = 'ajax';
Call above line in your function inside your controller file. by this way we can call the ajax layout.
Need to create a ajax.ctp file which is empty layout file.
$.get('/controller/action/'+Math.random(),{},function(data){
$('#myresult').html(data);
});
Where data will display in the inner html of result element.
0 Comment(s)