my css dosnt seems to work when I declare $ this-> layout = 'ajax' in my controller.
in my view1.ctp, I created a dialog using jquery. content will get from view2.ctp via jquery.ajax (). I created the html, id classes and all similar to view1.ctp.
im content gets ok. the problem is that id and classes i declared in view2.ctp do not work. In short, I get an empty dialog.
any idea on how to solve this? thank you in advance. Hooray!
in my view1.ctp:
<div id="thisDialog"> <div id="content"> </div> </div> <script> jQuery('.test_box').live('click',function(){ jQuery('#content').empty(); jQuery.ajax({ async:false, url: '/controller1/view2/'+id </script>
here is controller1.php
function view2($id) { $this->layout = 'ajax'; $query = $this->Model->find('all')
here view2.ctp
<div class='box'> <div class='title'> <h5>Title here</h5> </div> <div class='contents'> <table> <tr> <td class='head'></td> <td class='head'></td> </tr> <tr> <td class='alt'>Field content1 here</td> <td>Fields content2 here</td> </tr> </table> </div> </div>
source share