当我们在父页面中用Window新开一个窗口时,其实对于页面代码而言,这个窗口和父页面是同一页面。
<div id="MyPopWindow" modal="true" shadow="false" minimizable="false" cache="false" maximizable="false"
collapsible="false" resizable="false" style="width: 50%; margin: 0px; padding: 0px; overflow: auto;"></div>
<script type="text/javascript">
function showWindow(options) {
$("#MyPopWindow").window(options);
}
function closeWindow() {
$("#MyPopWindow").window('close');
}
showWindow({
title: "发布更新公告",
draggable: false,
closable: true,
width: 700,
height: 630,
href: "${ctx}/affiche/toPublishAffiche"
});
</script>
然后在子页面中,我们需要用到UEditor编辑器的插件,所以
var ue = UE.getEditor('content', {
autoHeightEnabled: true,
autoFloatEnabled: false,
elementPathEnabled: false,
wordCount: false,
imagePopup: false
});
正常时候,我们都是哪里需要用到什么插件就在哪个页面加上需要的JS之类的就OK了,可这次,我们如果把
<script type="text/javascript" src="${ctx}/resources/js/ueditor/ueditor.config2.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/ueditor/lang/zh-cn/zh-cn.js"></script>
这些JS写在子页面中,那么不好意思页面是会直接报错的。
所以这段JS代码是需要写在父页面当中。