views:

89

answers:

1

Hi,

I'm loading JQuery into my T3 page by :

page.headerData.10.value = <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;

and I'm including my javascript like this :

page.includeJS {
  file20 = fileadmin/templates/myjq.js
} 

Point is, i need the JQuery to be loaded first. but T3 puts it after my script. How do i get it swapped?

Thanks

+2  A: 
page.headerData.10 = TEXT    
page.headerData.10.value (
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
     <script type="text/javascript" src="fileadmin/templates/myjq.js"></script>
    )

and yes you need round braces here :) Instead of TEXT you can also use HTML.

edit: you can also do it like this

page.headerData.10.value = <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
page.headerData.20.value = <script type="text/javascript" src="fileadmin/templates/myjq.js"></script>
Rito