views:

162

answers:

2

I am currently trying to implement a jquery slider into a joomla website.

I already implemented NoConflict(); so that it doesn't step into joomla. And it works, BUT for another reason wich I do not understand it enters another jquery file called jsloader.js of a plugin I use for picture gallery display.

I suppose all the module jquery files get preloaded before the one im calling inside the template.

it enters the function() in the jsloader.js instead of the one in my jquery file.

How Can I force it to enter my jquery file instead of other

A: 

this are the scripts on my joomla site right now

The one I entered implicitly is

 **<script type="text/javascript" src="//templates/template/js/jquery-1.2.6.min.js">**

wich is at my template php

<script type="text/javascript" src="/plugins/system/cdscriptegrator/libraries/highslide/js/jsloader.php"></script>
  <script type="text/javascript" src="/plugins/system/cdscriptegrator/libraries/jquery/js/jsloader.php"></script>
  <script type="text/javascript" src="/plugins/system/cdscriptegrator/libraries/jquery/js/ui/jsloader.php?file=ui.core"></script>
  <script type="text/javascript" src="/media/system/js/mootools.js"></script>
  <script type="text/javascript" src="/components/com_jcomments/js/jcomments-v2.1.js?v=2"></script>
  <script type="text/javascript" src="/components/com_jcomments/libraries/joomlatune/ajax.js"></script>

  <script type="text/javascript" src="/includes/js/joomla.javascript.js"></script>
  <script type="text/javascript" src="/media/system/js/caption.js"></script>
  <script type="text/javascript" src="//templates/template/js/jquery-1.2.6.min.js"></script>
  <script type="text/javascript" src="http://www.generacionsinlimite.com/modules/mod_jTweet/js/jquery.tweet.js"&gt;&lt;/script&gt;
  <script type="text/javascript" src="/modules/mod_phocagallery_tree/assets/dtree.js"></script>
  <script type="text/javascript" src="http://www.generacionsinlimite.com/modules/mod_gk_news_image_1/js/importer.php?mid=newsimage1&amp;amp;animation_slide_speed=1000&amp;amp;animation_interval=5000&amp;amp;autoanimation=1&amp;amp;animation_slide_type=0&amp;amp;animation_text_type=1&amp;amp;base_bgcolor=transpa&amp;amp;text_block_opacity=0.45&amp;amp;thumbnail_width=50&amp;amp;thumbnail_margin=4&amp;amp;thumbnail_border=1&amp;amp;thumbnail_border_color=FFFFFF&amp;amp;thumbnail_border_color_inactive=000000&amp;amp;interface_x=0&amp;amp;interface_y=20&amp;amp;clickable_slides=1"&gt;&lt;/script&gt;
Johangsl
You should edit your question with the additional information, rather than posting an answer.
Dean Harding
The issue was a plugin called scriptegrator that was forcing its own code.
Johangsl
A: 

The first problem is that you've got the jquery.js file coming after the jsloader.js file. You need to make sure that jquery.js is included before any plugins - the order is important.

The second problem is that this:

<script type="text/javascript" src="//templates/template/js/jquery-1.2.6.min.js"></script>

Doesn't do what you think. When there are two slashes at the beginning of the URL, the browser interprets the first entry after the double-slash as the hostname, not a directory. What you actually want is:

<script type="text/javascript" src="/templates/template/js/jquery-1.2.6.min.js"></script>

With only one slash.

In case you're wondering, the reason for this is so that you can specify a file on a different host, but using the same scheme. So if you have a page that works in HTTP and HTTPS, then you can specify files on a different site, using the same scheme (HTTP vs. HTTPS) by using the src="//example.com/script/whatever.js" format.

Dean Harding
Im going to try it right now and let you know
Johangsl
ok I have changed it to one slash and it stills calls the function() of the wrong .js file, jloader.js
Johangsl
I've edited my answer: you still need to make sure that jquery.js is included *before* any jQuery plugins (jsloader in this case, apparently).
Dean Harding