problem with jquery

so i have some website layout that i want to use in yii

the problem is that it uses jquery.

so if i load "my" jquery the form ajax validation not working.

if i use yii jquery than my things with jquery not working.

any idea? tnx

Put this in your controller or view:


Yii::app()->clientScript->registerCoreScript('jquery');

tnx, but its not helping

the problem is when i use yii jquery than yii scripts workd and mine not

and if i load my own jquery than yii scripts not working(like ajax validation) and mine works

if i load both of them than only mine works

Yii uses




Yii::app()->clientScript->registerCoreScript('jquery');



to load jquery whenever it is needed.

For instance, when you put a form in a view, then CActiveForm will register ‘jquery’ as a core script, and when you put a grid in the same view, then CGridView will register the same ‘jquery’ as a core script. And in the output, thanks to CClientScript, only a single instance of jquery is loaded.

But, when you load jquery manually, then 2 instance of jquery will be loaded in the output and will cause a trouble.

So, do not load jquery manually, but use CClientScript::registerCoreScript() instead.

ok but when i not load jquery manually than my scripts wont work… only yii scripts does

How do you load jquery manually and how do you write your scripts?

Hi,

I’d also check at which order scripts are rendered - maybe it’ll help to find a problem.

Regrads