使用Google闭包库在拆分面板中打开URL

|| 此解决方案必须使用Google闭包JavaScript库,而不要使用任何其他JavaScript库。 加载网址时,我想动态打开一个拆分面板,其中一侧包含iframe中url的内容,另一侧包含有关正在执行的操作的日志信息。 以下是使用Google闭包库的拆分面板的常规设置,但是我不确定如何添加iframe并将其源设置为当前页面网址。
var lhs = new goog.ui.Component();
var rhs = new goog.ui.Component();

// Set up splitpane with already existing DOM.
var splitpane1 = new goog.ui.SplitPane(lhs, rhs,
    goog.ui.SplitPane.Orientation.HORIZONTAL);

// Need to create an iframe with src of current url and add that to the rhs element.
    
已邀请:
        渲染组件后,您应该能够仅获取基础元素并执行所需的任何操作。就像是:
var iframe = goog.dom.createDom(\'iframe\', { \'src\': \'rhs.html\' });
rhs.getElement().appendChild(iframe);
    

要回复问题请先登录注册