registerclient script

I am facing a problem with bind function of jquery of accordion. I am pasting the Yii::app()->clientScript->registerScript(‘accordions’,‘mybindcode’$("#sidebar div" ).bind( “accordioncreate”, function(event, ui) {


it is making problem because it goes to same script tag where orignal accorion funciton is written so conflict occurs .

Can i write code in new script tag of Yii::app()-clientScript

then it wont be the problem ???????????????

When registering jQ script, you shoudl use:

Yii::app()->clientScript->registerScript( 'xxx', 'my js jQ code', CClientScript::POS_READY );

important is the last parameter: POS_READY. Then your code will be rendered at bottom of the document inside jQuery onload handler.