Forum


HomeHomePublicPublicAdministrationAdministrationjQuery is Undefined for Regular UsersjQuery is Undefined for Regular Users
Previous
 
Next
New Post
9/7/2016 5:49 AM
 

I deployed an upgrade package on a test site to the latest version of dnn. Now whenever I login as a non-admin all my angularjs doesn't function because "jQuery is not defined". There must be a flag somewhere that got changed to exclude it when non-admins visit the page. Is there a simple fix? I've read to add it to my skin object like so: 

<%@ Register TagPrefix="dnn" TagName="JQUERY" Src="~/Admin/Skins/jQuery.ascx" %> <dnn:JQUERY ID="dnnjQuery" runat="server" />
I've added these lines to my Home.ascx then recompiled and installed but that did nothing. I do notice in my SkinBase.cs I have 

public class SkinBase : Skin
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            JavaScript.RequestRegistration(CommonJs.jQuery);
        }
    }

Shouldn't this force jQuery regardless? I'm not sure why this and only this install isn't working for non-admins...

 
New Post
9/7/2016 5:01 PM
 

jQuery should be registered on every page.  Knockout is the library that could only be registered when in Admin mode.  So that is strange that it is a jQuery problem.  But I am thinking the problem may be more of a jQuery conflict.  Maybe there is another version being registered on the page.  I would suggest turning off Client Resource Management (if it's not already) and looking at all your script register blocks in your html source to see which libraries are being registered and what order.

 
New Post
9/8/2016 4:42 AM
 

Thanks for your reply. It is a really odd problem. I looked at my html source and did a lookup for jQuery and it's not even attempting to load when a user is logged in. There's a bunch of scripts that are commented out in the source but none of them are the basic jQuery.min.js. I was able to create a patch for the problem. I created a module that was placed on all pages (that's a really handy feature) that on page pre-render forces jQuery to load. That has fixed the issue for now so I can move on but I'd still like to figure out what went wrong here.

 
Previous
 
Next
HomeHomePublicPublicAdministrationAdministrationjQuery is Undefined for Regular UsersjQuery is Undefined for Regular Users



Try FREE
30 days money back guaranteed