Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file Adding Jquery UI

More
11 years 3 months ago #1424 by jritchie
Adding Jquery UI was created by jritchie
Hello
I need to add jquery, and two jquery ui files to an article. The site was built using Joomla 1.5.

The page is working fine using plain html here:

www.para.com/2013TEST/Final/Forecast.html

I tried to add the code into the template, but it didn't work.

I have these files that are required, along with some javascript code to make this work:


<script src="jquery-1.7.2.min.js"></script>
<script src="jquery-ui-1.8.24.custom.min.js"></script>
<script src="jquery.ui.touch-punch.min.js"></script>

Thanks for your time.

Jennifer

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago - 11 years 3 months ago #1425 by admin
Replied by admin on topic Re: Adding Jquery UI
Hi Jennifer,
you need to edit the index.php file of your template.
Moreover, the jQuery library files need to be located at the root of the template. I would suggest you modify your script code because you may run into issues later on (you cannot keep $(function()...). Use jQuery(function($)...). You will need to make sure your libraries work with MooTools under the Joomla! environment. jQuery Easy can help you to do that, in which case it will limit your manual edits (and place the jQuery libraries at the right place in your template automatically).
To summarize: your site works fine as it is because you are not in Joomla!. When you add it into a Joomla! template, it conflicts with MooTools because MooTools and jQuery both use the '$' symbol. So you need to modify your code to avoid that. Follow the links on the jQuery Easy download page for more explanations :-)
Good luck!

Olivier.
Last edit: 11 years 3 months ago by admin.

Please Log in or Create an account to join the conversation.