页面1已经加载jq了,然后页面1中弹出一个层(取名页面2),然后页面2中用到了
<?php $form = $this->beginWidget('CActiveForm', array(
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
));
?>
结果页面2我本来没有加载jq,可是又再一次加载jq了,我看了一下CActiveForm类,$cs->registerCoreScript('yiiactiveform');这个会自动加载jq,请问怎么使页面2里不要再加载jq呢,强哥,这个怎么解决
Page 1 of 1
强哥,这个怎么解决,关于重复加载jquery的问题
#2
Posted 17 May 2012 - 02:23 AM
在你第2个页面:
Yii::app()->clientScript->scriptMap = array('jquery.js'=>false, 'jquery.min.js'=>false, 其它不需要的自动加载的js)
#3
Posted 24 July 2012 - 06:10 PM
1. if using Ajax, there is no issue on auto-reload jquery again, just refresh some 'div'.
2. always check source codes to make sure your codes are good performance.
3. I don't know the benefits of using 'widget' and 'CActiveForm' to generate a <form>, why not directly using HTML?
2. always check source codes to make sure your codes are good performance.
3. I don't know the benefits of using 'widget' and 'CActiveForm' to generate a <form>, why not directly using HTML?
Share this topic:
Page 1 of 1

Help












