I've read and re-read all the articles on jQuery, noConflict() and everything else and still have a problem. I need to use the jQuery UI library. As of right now, I need to load it on every page as I'm unsure when content editors will be placing these areas on pages. What I've done is to include the jQuery and jQuery UI in my <head> section like so:
<script src="//code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
I then have 2 other .js files I include at the bottom of my page for showing a dialog window and the other for toggling a "read more" section for a FAQ or news article.
Below is dialog window
jQuery(document).ready(function($){
$('#help-page').each(function () {
var $link = $(this);
var $dialog = $('<div></div>')
.load($link.attr('href'))
.dialog({
autoOpen: false,
title: '<h4>' + $link.text() + '</h4>',
width: 400,
modal: true
});
$link.click(function () {
$dialog.dialog('open');
return false;
});
});
});
Here is the news toggle
jQuery(document).ready(function ($) {
$(".ex_toggle .off a").click(function () {
$(this).parents(".ex_toggle").removeClass("off").addClass("on"), $(this).parents("li").find(".details").show(function () {
$(this).addClass("expand")
})
}), $(".ex_toggle .on a").click(function () {
$(this).parents(".ex_toggle").removeClass("on").addClass("off"), $(this).parents("li").find(".details").hide(function () {
$(this).removeClass("expand")
})
})
});
Some of the problem I know resides with using the webparts that use the /CMSScripts/jquery/jquery-core.js file but I'm hitting a brick wall now. I want to use all of the above but I think the main problem is the /CMSScripts/jquery/jquery-core.js file.
On my registration page I have the password strength control and also my dialog window. I get conflicts on this page and other pages that automatically include jquery-core.js all the time.
What can I do to resolve this? Never been a js or jQuery programmer so this is all foreign to me.