open 窗口 跨域访问:
问题:
比如: www.A.com 域名 用 OPEN 打开 www.B.com里面的内容 选择www.B.com 里面的内容返回到 WWW.A.com
解决步骤:
1.在www.A.com 准备testAffix.jsp,iframe.jsp,data.jsp
2.在www.A.com 准备需要访问的.jsp
testAffix.jsp代码:
<%@ page language="java" contentType="text/html; charset=GBK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>测试附件</title>
</head>
<body>
<input type="button" value="按钮" onclick="opens()"/>
<input type="text" value="" id="affixValue" name="affixValue"/>
<script type="text/javascript">
function opens(){
//var url="iframe.jsp?userName=人事科借阅";
var url="iframe.jsp";
window.open(url,'newwindow_db', 'height=600,width=760,toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=yes');
//var obj=window.showModalDialog(url,window,'dialogWidth:900px;dialogHeight:600px;status:no');
//alert('obj:'+obj.userId);
}
//affixValue 附件编号
//remark 备注
//isPrint 是否打印
//userId 用户编号
function setSelectAffixValue(affixValue,remark,isPrint,userId){
alert('obj');
alert(affixValue);
document.getElementById("affixValue").value=affixValue;
alert(remark);
alert(isPrint);
alert(userId);
}
</script>
</body>
</html>
iframe.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<iframe style="padding:0px;margin:0px;" src="http://192.168.0.197:8888/filemanage/module/interface/mainFrame.jsp?userName=人事科借阅&URL=http://192.168.0.197:8080/client/client/data.jsp" width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0" id="iframe" name="iframe"></iframe>
<script type="text/javascript">
function setSelectAffixValue(affixValue,remark,isPrint,userId){
opener.setSelectAffixValue(affixValue,remark,isPrint,userId);
}
</script>
</body>
</html>
data.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String affixId=request.getParameter("affixId");
String content=request.getParameter("content");
String printStr=request.getParameter("printStr");
String userId=request.getParameter("userId");
%>
<html>
<head>
<title>My JSP 'data.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<script type="text/javascript">
top.setSelectAffixValue('<%=affixId%>','<%=content%>','<%=printStr%>','<%=userId%>');
</script>
</body>
</html>
分享到:
相关推荐
有时候会碰到cuda报错,OSError: libcudart.so.10.0: cannot open shared object file: No such file 原因是cuda动态链接库没有链接上。 解决方法如下: cuda10.0: sudo ldconfig /usr/local/cuda-10.0/lib64 cuda...
1> window.showModalDialog()采用JS原理实现,同时父窗口不可操作,window.open()采用新创建一个窗口,同时父窗口可操作; 2> 父窗口与子窗口传递值的方式也有所不同,在子窗口中操作父窗口也语法也不同,分别为var...
Open Firmware Recommended Practice: Interrupt Mapping Version 0.9
OMPL的简要介绍, Open Motion Planning Library: A Primer
[root@localhost TMP]# /usr/bin/xdg-open: line 402: htmlview: command not found Failed to load core: /opt/Qt5.2.1/Tools/QtCreator/lib/qtcreator/plugins/QtProject/libCore.so: Cannot load library /opt/Qt...
当在网页中用javascript winow.open 打开一个新窗口后,是否能在你窗口中调用并执行新窗口中的代码或调取其中的元素? 答案是肯定的。 这段示例代码不但能在父窗口页面test.html中执行被打开的新窗口页面test-open...
欢迎使用 opencti! opencti的目标:统一语音卡,多媒体交换机编程接口。 它是一个通用的CTI开发库,兼容东进、三汇等厂商语音卡,交换机等产品。 你可以遵循CPL许可证下自由使用或发布本软件。 CPL许可证:Common...
解决openlayers跨域访问的解决方案,按照附件中说明.txt中步骤操作应该是没问题的,我已经测试过。
layer弹窗:top.layer弹窗到父页面跨域,通过postMessage方法将子页面的配置对象发送到父页面中,父页面再通过子页面的配置对象打开弹窗,对象内不能存在事件。
OSError: libcusparse.so.11: cannot open shared object file: No such file or directory 搜索全网,也没找到解决方案。最快解决方案如下: 1、在 /home/user/anaconda3/lib/ 中放入缺少的 libcusparse.so.11 文件...
mysql服务启动不了问题解决办法,文档描述,主要因数据文件损坏引起。
主要讲解了如何利用window.open打开新窗口,和打开新窗口时的一些参数的设置,很实用的。
openmm-tutorials:快速入门Python教程,帮助分子动力学从业人员快速掌握OpenMM
网友分享的能够解决fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory问题的程序。MySQL-python-1.2.3.win32-py2.7.exe-32位MySQL-python-1.2.3.win-amd64-py...
本文实例讲述了Laravel框架访问出错提示:`Warning require(vendorautoload.php) failed to open stream No such file or dire解决方法。分享给大家供大家参考,具体如下: 错误信息: `Warning: require(/...
java源码:人工智能工具包 OpenAI.zip
本文提供了解启动MongoDB时提示:error while loading shared libraries: libstdc++.so.6: cannot open shared object file: 错误的解决方案
从上图可以看出,Android的显示系统分为3层:UI框架层:负责管理窗口中View组件的布局与绘制以及响应用户输入事件WindowManagerService
Web开发中的window.open父子窗口传值问题 部署在tomcat中进行
OpenAI API Kotlin客户端 一个具有多平台和协程功能的简单Kotlin客户端。 :hammer_and_wrench: 设置 通过将以下依赖项添加到gradle.build文件中来安装OpenAI API Kotlin客户端: repositories { mavenCentral() ...