转自:http://www.cnblogs.com/yvesliao/articles/855989.html SocanSoft [廖勇军的DotNet博客]
写程序时想嵌入我的博客,我的是百度的,发现不能被框架,它会自动充满整个屏幕,发现源文件里有这一段:
top.location=self.location;
}

这是强行不被框架的代码,搜索后得到结果: 只要加上 <script>var location='';</script> 就OK了!
<!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>
<title>破解百度框架</title>
<script> var location='';</script></head>
<frameset rows="50px,*" border="0px">
<frame src="Top.aspx"></frame>
<frameset cols="120px,*">
<frame src="Menu.aspx"></frame>
<frame name="main" src="http://hi.baidu.com/yvesliao/blog/item/2834bbde558e605594ee370d.html"></frame>
</frameset>
</frameset>
<noframes>
你的浏览器不支持框架网页!
</noframes>
</html>
【分析: 上述转载的文章解决了将百度页面嵌入开发页面时会强行向上占据整个浏览器的问题,其原理是在框架页中定义一个location变量,当百度页面在调用top.location时,不再是指向上层页面的地址,而是其中的一个自定义的变量,因此上层页面就不会因为地址被改变而刷新为百度页面了。】