<%
String basePath = "";
String path = request.getContextPath();
basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<basePath value = "<%=basePath%>" id = "basePath"></basePath>
oldPage.jsp
//退回原因显示
$(function(){
$(".ok").bind("click", function() {
var basePath = $("#basePath").attr("value");
var thyy = $(this).text();
var obj = new Object();
//封装到JS对象中 进行传递
obj.thyy = thyy;
window.showModalDialog(basePath + "webmaster/welcome/newWord.jsp",obj,"dialogWidth=200px;dialogHeight=200px;center=yes;resizable=yes;dialogLeft=600;status=no");
});
})
<a href="javascript:void(0);" class="ok" ><s:property value="advice"/></a>
<a href="javascript:void(0);" class="ok" ><s:property value="advice1"/></a>
<a href="javascript:void(0);" class="ok" ><s:property value="advice2"/></a>
<a href="javascript:void(0);" class="ok" ><s:property value="advice3"/></a>
<a href="javascript:void(0);" class="ok" ><s:property value="advice4"/></a>
newPage.jsp
<script type="text/javascript">
$(function(){
var obj = window.dialogArguments;
$(".ok").text(obj.thyy);
})
</script>
<td class="ok"></td>
如果是span之类的 $(".ok").text(obj.thyy);
如果是input之类的 $(".ok").val(obj.thyy);