main.xhtml 页面包含:
<script src="#{applicationBean.resourcePath}/admin/js/jquery.min.js"></script>
<script src="#{applicationBean.resourcePath}/admin/js/jquery.actual.min.js"></script>
<script src="#{applicationBean.resourcePath}/admin/bootstrap/js/bootstrap.min.js"></script>
<!-- smart resize event -->
<script src="#{applicationBean.resourcePath}/admin/js/jquery.debouncedresize.min.js"></script>
<!-- js cookie plugin -->
<script src="#{applicationBean.resourcePath}/admin/js/jquery.cookie.min.js"></script>
<!-- js ui -->
<script src="#{applicationBean.resourcePath}/admin/js/jquery-ui.custom.min.js"></script>
<!-- tooltips -->
<script src="#{applicationBean.resourcePath}/admin/lib/qtip2/jquery.qtip.min.js"></script>
<!-- jBreadcrumbs -->
<script src="#{applicationBean.resourcePath}/admin/lib/jBreadcrumbs/js/jquery.jBreadCrumb.1.1.min.js"></script>
<!-- sticky messages -->
<script src="#{applicationBean.resourcePath}/admin/lib/sticky/sticky.min.js"></script>
<!-- common functions -->
<script src="#{applicationBean.resourcePath}/admin/lib/validation/jquery.validate.min.js"></script>
<script src="#{applicationBean.resourcePath}/admin/lib/tinymce/tiny_mce/tiny_mce.js"></script>
<script>
$.ajax({
type: 'POST',
url: '#{request.contextPath}/view/user/'+ page +'.xhtml',
success: function(data) {
$('#main_content').html(data);
}
});
<script>
正如您在上面看到的,我可以将 xhtml 页面(如下面的页面)包含到 main.xhtml
xhtml 页面中的行(确切顺序)
<!-- datatable -->
<script
src="#{applicationBean.resourcePath}/admin/lib/datatables/jquery.dataTables.min.js"></script>
<script
src="#{applicationBean.resourcePath}/admin/lib/datatables/extras/Scroller/media/js/Scroller.min.js"></script>
<link rel='stylesheet'
href='#{applicationBean.resourcePath}/admin/css/ui.dynatree.css' />
<!-- validation -->
<script
src="#{applicationBean.resourcePath}/admin/lib/validation/jquery.validate.min.js"></script>
<!-- sticky messages -->
<script
src="#{applicationBean.resourcePath}/admin/lib/sticky/sticky.min.js"></script>
<script
src="#{applicationBean.resourcePath}/admin/bootstrap/js/bootstrap.min.js"></script>
<script
src='#{applicationBean.resourcePath}/admin/js/jquery.dynatree.js'
type='text/javascript'></script>
<script type='text/javascript'
src='http://localhost:9090/app/dwr/util.js'></script>
<script type='text/javascript'
src='http://localhost:9090/app/dwr/engine.js'></script>
<script type='text/javascript'
src='http://localhost:9090/app/dwr/interface/ldapService.js'></script><script src='#{applicationBean.resourcePath}/admin/js/custom/organization.js'></script>
来自organization.js 的一行
treeDiv.dynatree('destroy');
我希望没有错误,因为“有时”它可以工作,但有时会给出“'treeDiv.dynatree' is not a function”
在 Chromium 中,我可以在 developer tools> network 中看到一个链接,然后单击它可以查看源代码:
jquery.dynatree.js?_=1377244144331