taste the diffrences of the following:element.document.all.frmtest.style; window.frames["frmtest"].style; window.frames["frmtest"].document.body.style;
element.document.all.frmtest is a reference of IRFRAME object under WINDOW object, and IRFRAME has style object, but window.frames["frmtest"] is a reference of WINDOW object, and WINDOW has not style object, however, window.frames["frmtest"].document.body has style object,so three above are object,undefined and object.
to: shyslysky(飞天) thanks再问一个问题在这个出现的iframe中如何再调用htc中的函数?window.frames["frmtest"].document.write("<h1>dad</h1><a onclick=Click()>aaa</a>");这样是不行的
you can not do like this, bucause the page of fratest is another one in which there is not Function Click() .you can do like the following:window.frames["frmtest"].document.write("<script language=javascript>function Click(){alert('hi!')}<"+"\/script> "); window.frames["frmtest"].document.write("<h1>dad</h1><a onclick=Click()>aaa</a>");Also, you can make Click() in fratest having the same function as Click() in a.htc.
window.frames["frmtest"].style;
window.frames["frmtest"].document.body.style;
and IRFRAME has style object,
but window.frames["frmtest"] is a reference of WINDOW object,
and WINDOW has not style object,
however, window.frames["frmtest"].document.body has style object,so three above are object,undefined and object.
window.frames["frmtest"].document.write("<h1>dad</h1><a onclick=Click()>aaa</a>");Also, you can make Click() in fratest having the same function as Click() in a.htc.