phpcms評論框iframe無法自適應問題

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   os   ar   java   sp   

問題背景:

之前用友言的時候改過網站的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了!

phpcms評論框iframe無法自適應問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.