using buil-in jquery

How to use built-in jquery core? what should I publish and where?

Two ways:

  1. Call the following method at any place of your page:


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


  1. Call the following in the head section of your page:


<?php echo CHtml::coreScript('jquery'); ?>


This actually produces an error:



<?php echo CHtml::coreScript('jquery'); ?>


There is no coreScript method in CHtml.

In the new versions you should do this:

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