I got this following problem with Yii of loading jquery everytime I use a widget.
For example:
I have a layout named main.php which I tend to register jquery here + fancybox.
<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<?php
$cs = Yii::app()->clientScript;
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.fancybox-1.3.4.js', CClientScript::POS_HEAD);
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.mousewheel-3.0.4.pack.js', CClientScript::POS_HEAD);
?>
I have a main page which I will use fancybox to load dynamic forms and these forms are built using CActiveForm
page: _simple_form.php
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'item-form',
'enableAjaxValidation' => true,
));
?>
ok, here I notified that everytime I load this form, jquery.js is listed in firebug:
http://localhost/shop-chara/assets/1827223d/jquery.js
at this time, jquery won’t recognize fancybox anymore.
$.fancybox.resize() => undefined
Please help!
Thanks