例:<html>
<head>
<title>a页面</title>
<script language="javascript">
</script>
</head>
<body onload="test()">
<iframe onload="this.height = this.contentWindow.document.documentElement.scrollHeight+5;" src="http://www.baidu.com/" id="ifm" width="100%" height="100%"></iframe>
</body>
</html>页面加载时会提示“没有权限”。在网上搜了一遍没找到好的解决方法。
<head>
<title>a页面</title>
<script language="javascript">
</script>
</head>
<body onload="test()">
<iframe onload="this.height = this.contentWindow.document.documentElement.scrollHeight+5;" src="http://www.baidu.com/" id="ifm" width="100%" height="100%"></iframe>
</body>
</html>页面加载时会提示“没有权限”。在网上搜了一遍没找到好的解决方法。
把这个贴出来~~~
跨域都会被警告阻止的啊,反正我没成功过。用PHP走代理吧。
onload="this.height = this.contentWindow.document.documentElement.scrollHeight+5;"
这个好像就是跨域了吧,test(),可以不要的。
————————————————————————————————
基于CSDN论坛提供的插件扩展功能,自己做了个签名档工具,分享给大家,欢迎技术交流 :)[/size]
有些跨域是可以用动态加载脚本来避开浏览器的权限检查的。谷歌地图的api和谷歌统计就是用了这个方法。