zoukankan      html  css  js  c++  java
  • 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了!

  • 相关阅读:
    湖南省队集训 Day 2
    一句话题解(~ 2020.4.9)
    NOIP 2017 宝藏
    NOIP 2017 逛公园
    bzoj 4767 两双手
    Codeforces Gym 101623E English Restaurant
    浅谈Tarjan算法
    Codeforces 1027F Session in BSU
    Codeforces Gym 101623A Ascending Photo
    2018-2019 ICPC, NEERC, Southern Subregional Contest (Online Mirror) Solution
  • 原文地址:https://www.cnblogs.com/savokiss/p/4059757.html
Copyright © 2011-2022 走看看