I am using ajax via js helper in my cakephp application;
for this I am using following code.
echo $this->Js->link('test','/controller/test/', array('before'=>$this->Js->get('#loading')->effect('fadeIn'),'success'=>$this->Js->get('#loading')->effect('fadeOut'),'update'=>'#mydiv'));
It is working fine.
But when I am using this code on view page,which is rendered by ajax, it i not working.
when i check the page source i found that script for this view is not added in the buffered script.
I guess buffered script is created when the page is load.In my case when page is loaded specific content is not loaded so script for this layout is not added in the buffered script.
Please guide me is there any other method by which i can do this or i have to do it by custom jquery or another method.
You should use evalScripts option in your Ajax Link. Here is the code:
And at the bottom of your Ajax view file. Be sure to include: