【问题标题】:How to increase the height of iframe from which you application is being called?如何增加调用应用程序的 iframe 的高度?
【发布时间】:2018-05-31 11:10:45
【问题描述】:

我有一个 React-On-Rails 应用程序,该应用程序正在其他应用程序的内部渲染,但我无权访问父组件代码。

我想从我的 react 应用程序中更改父 iframe 的高度。 如何实现?

【问题讨论】:

    标签: javascript html reactjs dom iframe


    【解决方案1】:

    您可以在父页面中定义一个函数:

    var setHeight = function(height){
        setIframeHeight(height)   
    }
    

    然后,在子页面中,你可以这样做:

    parent.setHeight(200)
    

    【讨论】:

    • 感谢您的建议。但是我无权访问父代码,我只能通过子组件来实现它。有没有办法从孩子访问父 dom?
    • 无法直接从child访问父dom,父页面不安全,父页面不允许。
    猜你喜欢
    • 1970-01-01
    • 2010-12-24
    • 2021-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-22
    • 2016-08-20
    • 2017-10-07
    相关资源
    最近更新 更多