phpcms评论框iframe无法自适应问题

问题背景:

之前用友言的时候改过网站的ip地址,改成127开头的了。但是协同开发的时候别人用的还是localhost。

结果在用评论的时候iframe死活不能自适应,看了一下源代码v9本身已经写过iframe自适应的方法,而且在之前那个项目中一点儿问题都没有。

那么问题来了,到底咋回事?

问题线索:

在firebug控制台中无意发现报了一个错,说js.html找不到,而js.html的地址是localhost开头的

js.html是v9JS站群跨域的一个文件(不知道啥意思),在v9根目录

下面是代码:

<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head><title>V9 JS站群跨域</title></head>
<body onload="a()">
<script type="text/javascript">
function a(){
    var q = location.search.replace('?','').split('|');
    if (top.document.getElementById('comment_iframe')) top.document.getElementById('comment_iframe').height=(q[0] ? q[0] : '0');
        if (top.document.getElementById('comment')) top.document.getElementById('comment').innerHTML=(q[1] ? q[1] : '0');
}
</script>
</body>
</html>

问题解决:

发现js.html里面用到了comment_iframe,也就是那个评论iframe,所以把路径改回localhost,OK了!

posted @ 2014-10-29 15:55  savokiss  阅读(726)  评论(0编辑  收藏  举报