admin管理员组文章数量:1323330
I have created custom DNN module that should use some JQuery
plugins.
I loaded plugins fine.
But getting error:
Uncaught TypeError: undefined is not a function imagesloaded.js?cdv=18:93
Uncaught TypeError: Object [object Object] has no method 'imagesLoaded' Masonry:755
GET http://dnn7site/jquery.min.map 404 (Not Found) Masonry:464
GET http://dnn7site/resources/shared/scripts/jquery/jquery.min.map 404 (Not Found)
And I think that this is because JQuery
is not imported in my custom module.
I included other JS
files like:
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/jquery.infinitescroll.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/masonry.pkgd.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/imagesloaded.js" />
But I don't know how to import JQuery
, any help?
I am using DNN 7.1.1
I have created custom DNN module that should use some JQuery
plugins.
I loaded plugins fine.
But getting error:
Uncaught TypeError: undefined is not a function imagesloaded.js?cdv=18:93
Uncaught TypeError: Object [object Object] has no method 'imagesLoaded' Masonry:755
GET http://dnn7site/jquery.min.map 404 (Not Found) Masonry:464
GET http://dnn7site/resources/shared/scripts/jquery/jquery.min.map 404 (Not Found)
And I think that this is because JQuery
is not imported in my custom module.
I included other JS
files like:
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/jquery.infinitescroll.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/masonry.pkgd.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/imagesloaded.js" />
But I don't know how to import JQuery
, any help?
I am using DNN 7.1.1
2 Answers
Reset to default 8Don't include jquery using the method described in the other answer. This will potentially cause conflicts with the jquery version that may be bundled with your DNN installation and/or other modules.
To include jQuery in DNN, it's as follows:
DotNetNuke.Framework.jQuery.RequestRegistration()
If you want jquery UI, use:
DotNetNuke.Framework.jQuery.RequestUIRegistration()
If you want to do it through a ASCX file, use this:
<%@ Register TagPrefix="dnn" TagName="JQUERY" Src="~/Admin/Skins/jQuery.ascx" %>
<dnn:JQUERY ID="dnnjQuery" runat="server" />
More information can be found here:
http://www.dnnsoftware./wiki/Page/jQuery
The version of jquery and whether it uses a hosted file can be configured in host settings -> advanced settings -> jquery settings.
If jQuery is required, try downloading the jQuery library and placing the jQuery script file in the same location as the other script files, and ensure that the jQuery library is reference before any other script files that require jQuery. For example:
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/jquery-1.9.1.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/jquery.infinitescroll.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/masonry.pkgd.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/.demo.masonry/Scripts/imagesloaded.js" />
However, the Masonry documentation suggests that jQuery is not required to run the plugin, so your problem may lie elsewhere
jQuery is not required to use Masonry. But if you do enjoy jQuery, Masonry works with it as a jQuery plugin.
本文标签: javascriptHow to import JQuery to custom dnn moduleStack Overflow
版权声明:本文标题:javascript - How to import JQuery to custom dnn module - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742139717a2422529.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论