尝试使用ajax来定位div,但它不起作用。所以现在我尝试使用像
这样的框架集<frameset border=0 rows="300, *">
<frame src="search.html" name="top" target="bottom">
<frame src="bottom.php" name="bottom">
</frameset>
search.html有一个表单,输入和提交按钮。我想在谷歌的底部看到谷歌的结果。
下面的bottom.php是重定向。
<?php
header( 'Location: http://www.google.com/scholar' ) ;
?>
Nytimes.com,bing.com和其他人都很好。但只有google.com才有&#34; SAMEORIGIN&#34;错误。
拥有它的最佳解决方案是什么?
提前致谢。
答案 0 :(得分:2)
正如您所识别的那样,Google会通过发送x-frame-options:SAMEORIGIN
响应标头来阻止框架。因此,除了来自同一域(google.com
)的网页外,无法构建Google网页。
X-Frame-Options
响应标头是一种安全功能,在现代浏览器中无法绕过。
<强>参考强>
X-Frame-Options
response header 如果您想在自己的网站上实施Google搜索,请查看Google Custom Search。