如何获取用window.open方法打开的页面的url
如何获取用window.open方法打开的页面的url在网站A一页面B(如www.testa.com/test.aspx)用window.open 打开另一网站B的页面如:http://www.test.com/test.aspx
怎样获在B站页面获取取到网站A的url --------------------编程问答-------------------- 没人答吗!自顶 --------------------编程问答-------------------- window.opener.location --------------------编程问答-------------------- To:levenwood
这样取出的值是空的!因为不是在同一个域下 --------------------编程问答-------------------- this.Page.RegisterStartupScript("", "<script language='javascript'>window.open('LookAndprint.aspx','newwindow', 'width=1024,height=680,depended=yes,top=0,left= 0, 易做图=no, titlebar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=yes');</script>"); --------------------编程问答-------------------- 再顶!还是没解决! --------------------编程问答-------------------- 高手些帮帮忙 --------------------编程问答-------------------- 1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
window.open("2.html")
</script>
</head>
<body>
</body>
</html>
2.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
document.write(window.opener.location)
</script>
</head>
<body>
</body>
</html>
这样是没问题的啊
------------------------------------------
实在不行就用url传值吧
window.open(http://www.test.com/test.aspx?url=********);
test.aspx里面Request.QueryString["url"]获得 --------------------编程问答-------------------- TO:kkai189
还是没对!因为我是不同域名下的两个页面,所以window.opener.location这个会报错,出现拒绝访问 --------------------编程问答-------------------- URL传值可行?
补充:.NET技术 , ASP.NET