DotNetNuke Jquery doesnt work in module
I have a开发者_如何学JAVA JQuery file that works fine on a normal webpage, but doesn't work inside of DNN.
DNN is pointing at the latest version of JQuery in the Host settings I have a container called news containing (news.css, news.ascx) and a module called newsdata.ascx inside of the container.
I have this code in the module to start launch the JQuery file:
<script type="text/javascript">
$(function() {
$("#controller").jFlow({
slides: "#slides",
width: "277px",
height: "150px",
duration: 250
});
});
</script>
But nothing happens. Am I placing the code in the correct locations?
Thanks
I would guess that you've run into an issue where $
isn't referring to jQuery
. Try changing the first line to jQuery(function ($) {
I figured this one out the hard way. To get your jQuery working on a DNN page, you must first instantiate it. To do this:
DotNetNuke.Framework.jQuery.RequestRegistration()
If you don't the core jQuery may never be added to the page.
http://www.dotnetnuke.com/Resources/Wiki/Page/jQuery.aspx
精彩评论