`

js 父窗口 和 iframe 之间的调用

 
阅读更多

 

//iframe ,其中id=Editor

<IFRAME SRC="<c:url value='/webpub/HtmlEditor/editor.htm'/>" id='Editor' width="100%" height="405" frameborder=0 scrolling=no></IFRAME> 

 

 

  //获取name='Ediotr'的iframe的dom对象

   var first  = document.all('Editor').contentWindow.document;

 

//如果iframe里还有iframe,获取最后子子frame的id,假设是id=HtmlEdit

           var second = first.all('HtmlEdit').contentWindow.document;

 

 

 

//调用name='Editor'的iframe 里setMode()方法

    frames['Editor'].setMode(0);

 

//name='Editor'的iframe 里调用父类的showProc()方法

  window.parent.showProc()

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics