DotNetNuke Wiki


jQuery

Modified on 2012/09/25 09:53 PM by Crispy Categorized as jQuery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery can be used in all versions of DotNetNuke, but native support was added for it in 5.0

With jQuery we have tried to provide a mechanism that only loads the jQuery library when absolutely necessary. If none of the modules or skin-objects on a page require jQuery, then it won’t be included in the page. If your module wants to use jQuery then you must include a long, complicated block of code that looks like this:

DotNetNuke.Framework.jQuery.RequestRegistration()

DotNetNuke Core Framework 4.x»

Please note that DNN 6.1.0 removed the internal usage of the flag "jquery_registered". Although this was a common workaround, it was technically peeking around the public API, which is inherently an unsafe act. The more robust alternative is to use a method such as Bruce Chapmon has on his blog, which shows how to use jQuery and jQuery UI safely within DotNetNuke 4 5 and 6.

Other tips about jQuery usage in DotNetNuke can be read here

jQuery UI»

If you are looking for information related to DotNetNuke jQuery-UI specific plugins, please see Reusable-DotNetNuke-jQuery-Plugins.

As of DotNetNuke 6, jQuery-UI is also shipped (and integrated) with the core. When registering jQuery-UI, there is no need to register jQuery as the jQuery-UI registration method will handle this for you. You can register jQuery-UI for use in your own work by using the following code (in Page Load or Init):

DotNetNuke.Framework.jQuery.RequestUIRegistration()

Other options»

Skin Objects for including jQuery, Javascript and CSS Stylesheets in DotNetNuke Skins

Skin Object»

A jQuery skin object was initially included with 6.0, however, as of 6.2 the following options are available.

For direct usage in .ascx skins:
<%@ Register TagPrefix="dnn" TagName="JQUERY" Src="~/Admin/Skins/jQuery.ascx" %>
<dnn:JQUERY ID="dnnjQuery" runat="server" />

HTML skin designers can use the JQUERY token:
[JQUERY]

The following properties for the skin object can be set to True/False (False by default):
  • DnnjQueryPlugins - If true, the dnn plugins used for panels and tabs will be loaded in addition to jQuery and jQueryUI.
  • jQueryHoverIntent - If true, the HoverIntent script used for tooltips will be loaded in addition to jQuery.
  • jQueryUI - If true, jQueryUI will be loaded in addition to jQuery.

Attend A Webinar
Start  Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke (DNN) provides a suite of solutions that make designing, building and managing feature-rich sites and communities fast, easy and cost-effective. The DotNetNuke Platform CMS is the foundation for more than one million websites worldwide. DNN Social, our newest solution, enables businesses to create immersive, interactive communities. Thousands of organizations like True Value Hardware, Bose, Cornell University, Glacier Water, Dannon, Delphi, USAA, NASCAR, Northern Health and the City of Denver have leveraged DNN to deploy highly engaging business- critical websites. Our rapid growth in product sales and deployments resulted in DotNetNuke Corp. being named one of the fastest growing private companies in America by Inc. Magazine in 2011 and 2012.