高分急求:两个html页面间传值问题

liurunze 2010-06-05 05:44:45
问题描述:
有两台服务器,都是IIS,服务器1的IP为192.168.1.2, 有页面A.html
服务器2的IP为202.3.43.1,有页面B.html

现在要将A页面的一个值传到B页面,B页面怎么接收?
必须html类型的页面,不能改成ASP/ASPX页面,页面名称不能动,因为这两个页面还有其他程序调用。

解决方法:利用脚本的父窗口调用
A页面:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function jikongconnect()
{
window.open("http://172.21.62.180:8080/gdkOA/aa.html");
}
</script>
</head>

<body>
<form name="bb" id="bb">
<table><tr>
<td width="139" align="left" onclick="jikongconnect()" valign="bottom">  <input type="hidden" name="tes" id="tes" value="1" /><font color="#999999">生产集控系统</font></td></tr></table>
</form>
</body>
</html>


B页面:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script language="javascript">
alert(window.opener.bb.tes.value=="1")
</script>
</body>
</html>

以上A页面用JS写的,B页面用VBS接收的,如果A页面和B页面部署到同一台服务器上时可以完美执行,但是如果分别部署两台服务器如上边最初描述的那样则提示:

网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
时间戳: Fri, 5 Jun 2009 09:42:40 UTC


消息: 没有权限: 'window.opener.bb'
行: 11
字符: 1
代码: 0
URI: http://202.3.43.1/B.html


怎么样实现两个服务器之间的HTML页面的传值?有没有办法?
网上有人说可以通过VBS获取浏览器地址的方法,但是没有说清楚
...全文
1269 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2010-06-06
  • 打赏
  • 举报
回复

<script language="vbscript">
Sub window_onload()
Dim s
s = location.search
s = Right(s,Len(s)-1)
If s="1" Then
MsgBox True
Else
MsgBox False
End If
End Sub
</script>

snowhite88 2010-06-05
  • 打赏
  • 举报
回复
用URL后面直接跟?变量&变量....的方法(get)
liurunze 2010-06-05
  • 打赏
  • 举报
回复
能不能用VBS写?
最好是VBS的,B页面还有其他程序都是VBS写的,谢谢
z109876543210 2010-06-05
  • 打赏
  • 举报
回复
同意楼上
hookee 2010-06-05
  • 打赏
  • 举报
回复
A

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function jikongconnect()
{
window.open("http://172.21.62.180:8080/gdkOA/aa.html?"+document.bb.tes.value);
}
</script>
</head>

<body>
<form name="bb" id="bb">
<table><tr>
<td width="139" align="left" onclick="jikongconnect()" valign="bottom">  <input type="hidden" name="tes" id="tes" value="1" /><font color="#999999">生产集控系统</font></td></tr></table>
</form>
</body>
</html>


B

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script language="javascript">
window.onload=function(){
var s = location.search;
s = s.substr(1,s.length-1);
alert(s=="1");
}
</script>
</body>
</html>

4,007

社区成员

发帖
与我相关
我的任务
社区描述
它是一种微软环境下的轻量级的解释型语言,它使用COM组件、WMI、WSH、ADSI访问系统中的元素,对系统进行管理。
社区管理员
  • vbScript社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧