如何在没有被劫持的iframe标签中显示网址?

时间:2011-08-16 09:54:01

标签: javascript iframe redirect http-status-code-302

我将“https://www.google.com/adsense/”设置为我网页上iframe标记的src属性值,但不会按预期显示google登录表单。

我试图在firefox,chrome和opera中加载页面,依此类推,但看到相同的空iframe而不显示任何内容。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<iframe name="box" id="box" target="_self" style="height: 100%; width: 100%;" src="http://www.google.com/adsense/">
</iframe>
</body>
</html>

我尝试执行“$ wget http://www.google.com/adsense/”,下面是回复:

--2011-08-16 17:06:23--  http://www.google.com/adsense
HTTP request sent, awaiting response... 302 Found
Location: https://www.google.com/adsense [following]

--2011-08-16 17:06:23--  https://www.google.com/adsense
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: /adsense/?gsessionid=qDCUpEipz54ooy_u661RMw [following]

--2011-08-16 17:09:33--  https://www.google.com/adsense/?gsessionid=qDCUpEipz54ooy_u661RMw
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.google.com/adsense/login2?gsessionid=qDCUpEipz54ooy_u661RMw [following]

--2011-08-16 17:09:34--  https://www.google.com/adsense/login2?gsessionid=qDCUpEipz54ooy_u661RMw
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.google.com/accounts/ServiceLogin?service=adsense&rm=hide&nui=15&alwf=true&ltmpl=adsense&passive=true&continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth2&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth2&hl=en_US [following]

--2011-08-16 17:09:34--  https://www.google.com/accounts/ServiceLogin?service=adsense&rm=hide&nui=15&alwf=true&ltmpl=adsense&passive=true&continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth2&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth2&hl=en_US
HTTP request sent, awaiting response... 200 OK

似乎问题是由302 http响应引起的。

我的问题是:

  • iframe标签是否有一些属性可以解决此问题?
  • 如何处理可能包含多个302 http重定向的页面在iframe中正常显示?

0 个答案:

没有答案