惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
J
Java Code Geeks
I
InfoQ
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
V
Visual Studio Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
有赞技术团队
有赞技术团队
月光博客
月光博客
Martin Fowler
Martin Fowler
量子位
L
LangChain Blog
B
Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

博客园 - 华威

Action中的变量无需声明 ascx中javascript事件没有激活 "does not esixt in the current content" error Sql Server中Select @Value和Select Value的区别 Ajax中使用Get而出现的古怪现象 FireFox对代码的要求比IE要严 ASP.NET的TextBox控件宽度和Columns属性有关 C#中问号的作用 Page.Validate()方法 decimal在存储过程和C#中的应用 JavaScript函数的参数列表的长度不固定 SQL中char和varchar类型 HyperLink的UnLoad事件 改变了系统的地区设置,但是C#中的DateTime不是立刻生效的 在DataGrid里面取特殊字段值 事件两次激发? DataList里面的事件初始化 ajax 关于SqlDataReader.Read()方法
从当前窗口返回原窗口打开新页面的JavaScript代码
华威 · 2007-08-02 · via 博客园 - 华威

例如:
1。点击第一个窗口a中的链接,打开一个新窗口b。
2。点击窗口b中的button,将会运行一个新的页面, 而这个新的页面在窗口a中打开,不是在窗口b中打开。

实现方法:

1。在窗口b的<head></head>之间加入以下代码:
<script language=javascript>
var openerwin = window.opener
</script>
2。在窗口a的<body></body>之间添加标签如下:
<a href="" target=openerwin></a>
3。在窗口b的那个返回button中加入如下C#代码:
Response.Write("<script language=javascript>window.opener.location.href='http://www.xxx.com'</script>")

参考:
http://www.oosky.cn/topicView.aspx?Id=40673