如何仅通过javascript来显示带参数的iframe

| 我遇到了这个资源,其中.js文件提取了iframe。 资源 js文件:
window.document.write(\"<iframe src=\\\"somedomain.com/page.htm\\\"/>\");
但是我不确定如何添加宽度/高度/滚动等属性。此外,在iframe的末尾,我还想添加图像并进行链接     
已邀请:
        由于这是从document.write开始的,因此只需继续:
document.write(\"<iframe src=\\\"somedomain.com/page.htm\\\"/ width=200 scrolling=\'no\'>\");
请注意,在某些情况下,HTML实际上不需要属性的引号(请参见
width
),但可以像
src
一样添加它们。也可以用
\'
代替
\"
,它简化了转义(请参阅
scrolling
)。请保持一致,以上注意事项仅供参考。 快乐的编码。     
        您可以使用相同的方法:
window.document.write(\"<iframe src=\\\"somedomain.com/page.htm\\\" width=\'300\' height=\'900\' ></iframe>\");
请注意,iframe不是自闭元素标签,但是大多数浏览器将正确呈现。您可以在代码内输入替代内容,以防浏览器不支持iframe     
        您能以某种方式获得对Frame的引用吗..如果它是页面上的第一个iframe,则可以使用索引[0] 函数removeScroll() { window.parent.frames [0] .scrolling = \“否\”; }     
        尝试使用本机方法createElement
      var tempIFrame=document.createElement(\'iframe\');
      tempIFrame.setAttribute(\'id\',\'RSIFrame\');
      tempIFrame.style.border=\'0px\';
      tempIFrame.style.width=\'0px\';
      tempIFrame.style.height=\'0px\';
      IFrameObj = document.body.appendChild(tempIFrame);

      if (document.frames) {
        // this is for IE5 Mac, because it will only
        // allow access to the document object
        // of the IFrame if we access it through
        // the document.frames array
        IFrameObj = document.frames[\'RSIFrame\'];
    

要回复问题请先登录注册