Jquery Register Problem In Widget

Hi all,

I’d like to apply a jquery plugin in a list of news.

I created my widget to include this box in some page of mysite.

The problem is that in the page rendered, in the source code seems that the js file and script is loaded correctly but the plugin doesn’t work…

<script src="/juvebook/js/jquery.totemticker.min.js" type="text/javascript">

and the script too:

<script type="text/javascript">









This is the view file of my widget:


Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.totemticker.min.js', CClientScript::POS_HEAD); 

$js = "






Yii::app()->clientScript->registerScript('totemSlideNews', $js, CClientScript::POS_HEAD);


<ul id="vertical-ticker">


foreach($news as $currentNews)

{ ?>

    <li class="feednews">

        <div style="float:left; width:30%;">

            <p><?php echo $currentNews['datePubb']; ?></p>

            <p><?php echo $currentNews['header']; ?></p>



            <?php echo $currentNews['title']; ?>



<?php } ?>


So, the question is, can i include the js used only by a widget directly in his view file?

If yes why firebug, when i try to run by console the script say “$(”#vertical-ticker").totemticker is not a function", like if the library didn’t loaded?

Thank you