1,在IFRAME网页内部获取该IFRAME的id:
1 var frameId = frameElement.id;
2,动态创建IFRAME元素:
1 var dvMain = parent.document.getElementById( " dvMain " ); 2 var newFrame = document.createElement( " IFRAME " ); 3 newFrame.setAttribute( " id " , " id_new_frame " ); 4 newFrame.setAttribute( " src " , " http://www.baidu.com " ); 5 dvMain.appendChild(newFrame);
PS:测试对Firefox3.6.3&IE6.0通过.