Yii Framework Forum: How To Change Position Of Asset Generate Js - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Change Position Of Asset Generate Js how t Rate Topic: -----

#1 User is offline   ashes 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-March 13

Posted 22 March 2013 - 02:04 PM

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!
0

#2 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,311
  • Joined: 21-February 11
  • Location:Greece

Posted 22 March 2013 - 04:48 PM

Hi Ashes

The Jquery core must be resided first of all, why do you want to do that?
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#3 User is offline   ashes 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-March 13

Posted 22 March 2013 - 09:58 PM

View PostKonApaz, on 22 March 2013 - 04:48 PM, said:

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
0

#4 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,311
  • Joined: 21-February 11
  • Location:Greece

Posted 23 March 2013 - 03:44 AM

View Postashes, on 22 March 2013 - 09:58 PM, said:

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
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users