Learn More





DNN Community Blog

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.

DotNetNuke and jQuery: An Overview

Recently I received an email from someone who had attended one of my DNN training sessions asking to clarify some questions about jQuery usage. This person was just getting started with jQuery in DNN, and had inherited a skin that loaded jQuery itself, but they also realized that DNN was loading jQuery as well. They noted that everything seemed to be working fine, but were a little apprehensive that one day things may grind to a halt.

Instead of just replying to the email, I’m going to answer these questions publicly in hopes that it benefits others.

How does DNN load jQuery?

Years ago (late 2008, I think), DNN 5.0 added direct support for loading jQuery. Since then, the right way to load jQuery from a skin or a module, is to ask DNN to register it for you. So think of it like this – every time DNN loads a page, it’s waiting for someone to say “I want jQuery!”. If nobody says that – it won’t be loaded. If one module or skin says that – it will be loaded once. If 20 modules ask for jQuery, it will still only be loaded once. Same goes for jQuery UI, which was introduced in DNN 6.

When jQuery or jQuery UI is loaded by DNN, the DNN options set in the Host settings are used:


So if DNN loads jQuery, and the skin/module loads jQuery, which is actually being used?

The answer to this one is quite simple. The last one to load will win. This is because both of the scripts will be defining the global jQuery object. So the second one will literally overwrite the first one.

Any potential issues upgrading DNN, or using DNN modules?

Sure! You could experience a wide variety of issues if jQuery is being loaded more than once. It is really quite unpredictable given the variety of ways people can organize/load JavaScript on a page in DNN, and the extent to which they do (jQuery is really common).

If you are loading two different versions of jQuery, you may have functionality that depends on a particular version. If for some reason that version is being loaded first and getting overwritten by another (presumably older) version, your functionality would likely just stop working.

Additionally, there are some interesting repercussions for plugins when jQuery is loaded more than once, as plugins just extend the jQuery object. For example:

  1. jQuery is loaded by DNN. The jQuery object is defined.
  2. A jQuery plugin extends the jQuery object with its functionality.
  3. A skin or module loads jQuery. The jQuery object is redefined, and its like the plugin never got loaded.

Why do some modules have settings for loading jQuery?

In an effort to support multiple versions of DNN, module developers that create modules which depend on jQuery will often give the administrator an option to opt out of loading jQuery. If you’re opting out, the module developer assumes that you’re loading it via some other mechanism, presumably through the core functionality in DNN.

What to do?

Try to only load jQuery once. This means using the API to register jQuery if you are developing a module or skin. It also means telling any module that has the option to *not* load jQuery itself, but to use DNN.


Want to register jQuery the right way? Check out these community resources:

If you have any questions or any more techniques/resources please post them in the comments.


Timo Breumelhof
There's the jquery skin object now...
<%@ Register TagPrefix="dnn" TagName="jQuery" src="~/Admin/Skins/jQuery.ascx" %>
Timo Breumelhof Friday, November 15, 2013 1:46 PM (link)
Timo Breumelhof
Don't forget to add this too :-)
Timo Breumelhof Friday, June 20, 2014 4:01 PM (link)
Timo Breumelhof
Timo Breumelhof Friday, June 20, 2014 4:01 PM (link)
Timo Breumelhof
<dnn:jQuery runat="server" />
Timo Breumelhof Friday, June 20, 2014 4:02 PM (link)

Comment Form

Only registered users may post comments.


2sic Daniel Mettler (124)
Aderson Oliveira (15)
Alec Whittington (11)
Alex Shirley (10)
Andrew Nurse (30)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (21)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (203)
Chris Paterra (55)
Clinton Patterson (28)
Cuong Dang (21)
Daniel Bartholomew (2)
Dave Buckner (2)
David Poindexter (3)
David Rodriguez (2)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (74)
Geoff Barlow (6)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (269)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matthias Schlomann (15)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Mike Horton (19)
Mitchel Sellers (28)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Peter Donker (52)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott S (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (2)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (37)
Will Strohl (163)
William Severance (5)
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?