父面頁
function queryList(){ var url="./xtwh/personSearch.do?method=personSearch&go=dialogWrapper"; url = url.replace("?","%3f"); url = url.replace(/\&/g,"%26"); url = url.replace(/\=/g,"%3d"); var obj = showModalDialog("../dialogWrapper.jsp?url="+url,window,"dialogWidth:860px;dialogHeight:500px;scroll:no;status:no;"); if (obj != undefined&&obj != null&&obj != "") { //alert(obj); var tmp=obj.split("|"); $("#sys_person_info_id").val(tmp[0]); $("#name").val(tmp[1]); }}
中間頁面 dialogWrapper.jsp 放在WebContent,WebRoot下面
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%><html><head><title>網頁對話方塊</title><meta http-equiv="Cache-Control" content="no-store"/><meta http-equiv="Pragma" content="no-cache"/><meta http-equiv="Expires" content="0"/><script type="text/javascript" >function getTime(){setTimeout(settitle,300);}function settitle() {var child_document=frames["wrapper"].document;var child_title=child_document.title;if(child_title!=undefined&&child_title!=null&&child_title!=""){document.title=child_title;}}</script></head><body onload="getTime()" ><table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <iframe name="wrapper" id="wrapper" width="100%" height="100%" frameborder="0" src="<%=request.getParameter("url")%>"></iframe> </td> </tr></table></body>
子頁面
function okRadio(id, name, sex) {var _returnvalue = id + "|" + name;parent.window.returnValue = _returnvalue;window.close();}