【发布时间】:2014-08-03 13:40:41
【问题描述】:
我试图在我的自定义 dnn 模块中显示一个 jQuery 模态弹出窗口,为此我使用了下面的代码,效果很好。
<div id="dialog-form" title="Notices">
<div>
My Notice 1
</div>
</div>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script type="text/javascript">
$(document).ready(function () {
$("#dialog-form").dialog({
modal: true,
buttons: {
Close: function () {
$(this).dialog("close");
}
}
});
});
</script>
我担心的是,在上面的代码中,我直接使用链接标记引用了 jQuery UI 文件,并且我知道 DNN 本身带有 jquery UI 文件。所以必须有一些方法来避免直接引用 UI css 文件并使用 dnn 已经附带的东西。
我曾尝试在后面的模块代码中使用以下几行,但它们都不适合我
DotNetNuke.Framework.jQuery.RequestUIRegistration();
JavaScript.RequestRegistration(CommonJs.jQueryUI); //obsolete in DNN7.2
我也尝试了下面链接中提到的方法 http://www.ifinity.com.au/Blog/EntryId/121/Using-jQuery-UI-with-DotNetNuke-5-and-6-in-the-same-module
【问题讨论】: