在页面a.jsp中利用Jquery Easyui弹出一个窗口projectdir,里面包含一个页面b.jsp,在对b.jsp进行操作后,希望刷新b.jsp的内容,那么可以在b.jsp页面利用ajax提交获取返回页面,然后在ajax脚本的success函数中加入$("#projectdir").html(response);详细脚本如下:
a.jsp主要内容
然后在b.jsp页面中调用enter函数即可。
<script type="text/javascript">
$(function() {
$('#projectdir').window({
title:'指定项目工程目录',
width:680,
height:400,
closed: true,
href: 'fileAction!connect',
modal:true
});
})
function enter(val) {
$.ajax({
url : 'fileAction!connect',
data : {
dir :val
},
dataType: "html",
type:'post',
contentType: "application/x-www-form-urlencoded; charset=utf-8",
cache : false,
success : function(response) {
$("#projectdir").html(response);
}
});
}
</script>
a.jsp主要内容
<a href="javascript:void(0)"
onclick="$('#projectdir').window('open')">浏览</a>
<div id="projectdir">
</div>
然后在b.jsp页面中调用enter函数即可。