一、Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&& //父对象得到子窗口的值 //ObjectID 是窗口标识,ContentID 是元素ID function GetValue(ObjectID,ContentID) { var IsIE = (navigator
appName == 'Microsoft Internet Explorer') if(IsIE) {//如果是IE alert(document
frames(ObjectID)
document
getElementById(ContentID)
innerHTML); } else {//如果是FF alert(document
getElementById(ObjectID)
contentDocument
getElementById(ContentID)
innerHTML); //FF 下不支持innerText; 下面是解决方法 //if(document
all){ // alert(document
getElementById('div1')
innerText); //} else{ // alert(document
getElementById('div1')
textContent); //} } } //父对象向子窗口赋值 //ObjectID 是窗口标识,ContentID 是元素ID function SetValue(ObjectID,ContentID) { var IsIE = (navigator
appName == 'Microsoft Internet Explorer') if(IsIE) {//如果是IE documen