Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Skin causing JQuery conflicts?Skin causing JQuery conflicts?
Previous
 
Next
New Post
11/12/2012 11:35 PM
 

I am getting the following error below on a few pages. However, It only seems to occur on pages that have a certain customized skin. I have read articles about similar errors, which stated that if there are JQuery references, i.e.(<script src="http://code.jquery.com/jquery-latest.min.js"></script> )within an .aspx page, that they can conflict with built in DNN references, causing the jQuery library not to load properly. This leads to a method not found error on JQuery calls. Any thoughts on what might be the issue here, with regards to the customized skin?

<script type="text/javascript">

jQuery(document).ready(function ($) {
if (!$(".dnnControlPanel").data("loaded")) {
var yesText = 'Yes';
var noText = 'No';
var titleText = 'Confirm';

// Client IDs for the following three have _CPCommandBtn appended as a rule
$('#dnn_RibbonBar_DeletePage_CPCommandBtn').dnnConfirm({
Uncaught TypeError: Object [object Object] has no method 'dnnConfirm'
text: 'Are you sure you want to delete this page?',
yesText: yesText,
noText: noText,
title: titleText
});
 
New Post
11/13/2012 9:25 AM
 
Cant tell much from here, do you have a live url?
 
New Post
11/13/2012 10:34 AM
 

I was actually able to figure this out last night. It turns out that is was multiple Jquery references within the skin being loaded. This is for a contract job, so I'm not sure who created the custom skin, but they wrote in a reference to jquery (<script src="http://code.jquery.com/jquery-latest.min.js"></script>) in two different spots of the .ascx page. I added the following conditional statement to check if the Jquery library was already being loaded, which has stopped the errors.

<script>    window.onload = function() {
        if (window.jQuery === undefined) {
            var script = document.createElement('script');
            script.src = 'http://code.jquery.com/jquery-latest.min.js"';
            document.getElementsByTagName('head')[0].appendChild(script);
        }
    };</script>


I was trying to figure out how to implement the dnn jquery register, but was unsuccessful at removing the error. As far as I can tell everything is still functioning correctly. Do you all have any suggestions on a better method to resolve this solution. I only have access to an admin account, so I can't get into the host settings. Do you think the host should update the Jquery reference in the host settings to be "http://code.jquery.com/jquery-latest.min.js"? They are using either DNN 5 or 6, not sure which.

Thank you for helping


 
New Post
11/14/2012 3:43 AM
 

Normally in v5 and 6 DNN already loads jQuery.
(when Admin > Site Settings > Appearence > Skin Widgets is checked)
So there's no real reason to also load it from the skin when you control the installation..

Many skins developed for DNN 4 cause these kind of errors as in those days jQuery was not included in DNN.

Will has a good blog post on jQuery and DNN:
http://www.willstrohl.com/Blog/PostId...

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Skin causing JQuery conflicts?Skin causing JQuery conflicts?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out