Load jQuery UI tabs in same page using AJAX -


i using cakephp(2.5.4) jquery ui tabs(jquery-ui.1.8.20) create tabs , populate contents via ajax on view page.

my problem when navigate through tabs, new contents placed in same page(one below other).

how can make each content appear under own tab?

here script:

<script>     var st_id = <?php echo $data1['town']['municipality'];?>;     //console.log(st_id);     $(function(){         $("#mytabs").tabs({             ajaxoptions : {                 type :"post",                 data:{postdata:st_id},                 error:function(xhr,status,index,anchor){                     $(anchor.hash).html("could not load tab");                 },                 success:function(response){                     console.log(response);                 }             }         });     }); </script> 

and div structure

<div id='mytabs'>     <ul>         <li><a href='#content_1' title='content_1'>tab1</a></li>         <li><?php echo $this->html->link('tab2',array('controller' => 'towns','action' => 'viewtown'),array('title' => 'content_2')); ?></li>         <li><?php echo $this->html->link('accounts records',array('controller' => 'towns','action' => 'viewaccounts'),array('title' => 'content_3'));?></li>         <li><?php echo $this->html->link('population',array('controller' => 'towns','action' => 'viewpeople'),array('title' => 'content_4')); ?></li>     </ul> <div id='content_2'></div> <div id='content_3'></div> <div id='content_4'></div> </div> 

probably div tag not close, sure tags appropriate closed.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -