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, ...jQuery & DNN questionsjQuery & DNN questions
Previous
 
Next
New Post
7/5/2014 2:41 AM
 

Hi,

I created a skin.  Just using this code:

<%@ Control language="C#" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>

<div class="container">

<div id="ContentPane" runat="server"></div>

</div>

When I view the source, WHEN logged out, I see the following jQuery is automatically added to the page:

<script src="/Resources/libraries/jQuery/01_09_01/jquery.js?cdv=23" type="text/javascript"></script>

<script src="/Resources/libraries/jQuery-Migrate/01_02_01/jquery-migrate.js?cdv=23" type="text/javascript"></script>

<script src="/Resources/libraries/jQuery-UI/01_10_03/jquery-ui.js?cdv=23" type="text/javascript"></script>

My questions are these:

1- It appears the jQuery libraries will load on every page even if the page does not require jQuery. Is this correct?

2- I went to host settings and selected Microsoft Ajax CDN. I was under the impression that DNN would use the CDN instead of the self-hosted files if I made that selection. When I view source on the same page above, I don't see the CDN. All I see is the paths to the self-hosted files. I assumed that the CDN would show with possibly a fallback to the self hosted libraries. So, what do I need to do to make it happen? It seems if I hard code, then I will end up with duplicating the libraries.

Thanks.

 
New Post
7/5/2014 3:03 AM
 
1. jQuery should only be loaded, if one of the modules, skin objects or the core itself requires it (e.g. for control panel).
2. this should only affect MS Ajax library, all other libraries (jQúery etc) are configured in JS Library Management

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/5/2014 3:14 AM
 

this should only affect MS Ajax library, all other libraries (jQúery etc) are configured in JS Library Management

I found the JS library on the extensions page. I'm guessing this is the one you are talking about? Anyhow, it's says the default CDN for jQuery is Google.

So I log in to make sure jQurey is required. I view source and it is still not using a CDN for jQuery. This is a new install of DNN 07.03.01 (20) .

I'm at a loss. How do I get DNN to use a CDN for jQuery and a fallback to self-hosted files ONLY if the CDN is down.

On a regular site I could do this:

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script>window.jQuery || document.write('<script src="jquery-1.11.1.min"><\/script>')</script>

The information I have found for DNN and jQuery is somewhat confusing and lacking, but all seen to agree that using a script tag is a bad idea.

 

 
New Post
7/5/2014 6:36 AM
 
In Host Settings, you may enable/disable JS libraries to be obtained from a CDN, in Admin > Extensions you may specify the CDN location (otherwise default location is used)

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/5/2014 2:56 PM
 

otherwise default location is used

Ok I have figured it out. It really is confusing. So, just in case somebody else needs to know:

For starters you would think everything can be done from the "Host Settings". Well it is, but is not apparent.

Host settings > advanced > CDN. Check the box "use JavaScript libraries CDN".

That's it. All there is to it.

But if you want to know what the what is going on when you check "use JavaScript Libraries CDN", you have to go to the host > extensions and scroll down to JavaScript libraries to see where the defaults go which is Google. You have the ability to change the defaults as well there.

Once done, you can view the source code and see that is calling the CDN.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...jQuery & DNN questionsjQuery & DNN questions


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.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out