以前我们写jsp的时候,引入其他页面并且运行它都是用
<%@ include file="/query_test.jsp"%>这种标签的,
那么现在有另外一种方法可以用,就是Ajax,以下是用法;
<script type="text/javascript" src="${sessionScope._contextPath}/js/simpleAjax.js">
window.onload = function() {
callServer('${sessionScope._contextPath}/query_test.jsp', dp); }
function dp() {
}
</script>
就可以了~
本文介绍了在JSP中使用两种不同的页面引入方式:传统的<jsp:include>标签与现代的Ajax技术。通过示例展示了如何利用Ajax异步加载指定的JSP页面。
2793

被折叠的 条评论
为什么被折叠?



