jQuery conflict
Permalink
I am in sort of trouble, I am turning a html to concrete5 and almost done with all levels making the areas editable, but getting jQuery conflict my Edit page in top of the toolbar not working, I am pasting down the line of code which is creating problem
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
please assistance needed...very urgent.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
please assistance needed...very urgent.
Yes I did that I made that line of code as a comment earlier and now totally removed that line. Now, Edit Page is working fine but the effects which was coming with javacript are not working.
This line of code not working.
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/jquery.template.js"></script>
This line of code not working.
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/jquery.template.js"></script>
You have run into the corollary of the above. C5 only loads jQuery by default for the dashboard.
A simple way round if you are doing small scale development is to use my 'load jQueryUI' addon. This makes sure that jQuery and jQueryUI are always loaded from the concrete5 copy. Maybe not so convenient for a theme.
Hence another way to handle it is to load the C5 copy of jQuery using addHeaderItem(). This will filter out duplicate loads and, because it is the C5 copy, will avoid any duplicate declaration issues that loading an external copy could lead to.
You can tidy this up further by putting it in a conditional so it only even attempts to load when the dashboard toolbar is not shown. You will already have such a condition in your theme to add a shim at the top of a page when the dashboard toolbar is shown.
A simple way round if you are doing small scale development is to use my 'load jQueryUI' addon. This makes sure that jQuery and jQueryUI are always loaded from the concrete5 copy. Maybe not so convenient for a theme.
Hence another way to handle it is to load the C5 copy of jQuery using addHeaderItem(). This will filter out duplicate loads and, because it is the C5 copy, will avoid any duplicate declaration issues that loading an external copy could lead to.
You can tidy this up further by putting it in a conditional so it only even attempts to load when the dashboard toolbar is not shown. You will already have such a condition in your theme to add a shim at the top of a page when the dashboard toolbar is shown.
What does the "template.js" file do? Is that a UI script? If so, you probably don't need that, either.
Can you provide a link? I'll look at your source to see if I can tell what's wrong.
Can you provide a link? I'll look at your source to see if I can tell what's wrong.
Concrete itself already automatically includes jquery. I believe the latest version of Concrete uses jquery 1.7.1.
This means that you DO NOT add that line of code.
Hope this helps?