How To Change Position Of Asset Generate Js

Hi everyone,i have searched alots but didnt find my answers .

The problem is :


<html>

    <head>

        // Yii auto generate file and set it first :

        <link rel="stylesheet" type="text/css" href="/Candy/assets/7e1d76e1/gridview/styles.css" />

        <link rel="stylesheet" type="text/css" href="/Candy/assets/8f1dacca/pager.css" />

        <script type="text/javascript" src="/Candy/assets/c1fb563a/jquery.js"></script>

        <script type="text/javascript" src="/Candy/assets/c1fb563a/jquery.ba-bbq.js"></script>

        <title>some text</title>

        // my js file here :

        <script type="text/javascript" src="/Candy/js/jquery-1.2.3.pack.js"></script>

        <script type='text/javascript' src="/Candy/js/jquery-1.6.js"></script>

        <script type="text/javascript" src="/Candy/js/jquery.idTabs.min.js"></script>



This auto-gen make Jquery conflicted , and all i want to do is make my script before the auto-gen js.

i have tried something like this:


<?php Yii::app()->getClientScript()->registerCoreScript('jquery', CClientScript::POS_HEAD); ?>

but my script still after the assets/…js.

Can anyone help me this problem please!

Hi Ashes

The Jquery core must be resided first of all, why do you want to do that?

yes , looklike it was conflicted with jquery-1.6.js .and i want to move it after jquery-1.6js

i will fix this by my self . thanks you for reply

Hi Ashes

you could register your javascript directly in <head> without using


Yii::app()->clientScript->registerScriptFile('yourScript.js');

but directly like this


<script type="text/javascript" src="yourScript.js"></script>

and then in anyplace insert the bellow code


Yii::app()->getClientScript()->registerCoreScript('jquery', CClientScript::POS_HEAD);

I tested it and works, yourScript.js will be inserted before jquery core