我正在使用
bootstap tabs
,我试图通过ajax加载内容,而不是用PHP设置。我的代码:
<script type="text/javascript">
function test(e){
console.log(e.target);
//load ajax stuff here
}
</script>
<?php
$this->widget('bootstrap.widgets.TbTabs', array(
'type'=>'tabs',
'placement'=>'above', // 'above', 'right', 'below' or 'left'
'tabs'=>array(
array('label'=>'Ogólne', 'content'=>'Czekaj...', 'active'=>true),
array('label'=>'KsiÄ
żka adresów', 'content'=>'Czekaj...'),
array('label'=>'CoÅtam', 'content'=>'Czekaj...'),
),
'events'=>array('shown'=>'test')
)); ?>
然而,我一直收到这样的错误:
Uncaught TypeError: Object test has no method 'apply'
。我尝试创建一个对象,但仍然没有成功。有什么想法吗?
稍微澄清一下,JS代码由框架创建:
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('a[rel="tooltip"]').tooltip();
jQuery('a[rel="popover"]').popover();
jQuery('#yw0').tab('show');
jQuery('#yw0').on('shown', 'test');
jQuery('#collapse_0').collapse({'parent':false,'toggle':false});
});
/*]]>*/
</script>