var
viewFrameLength
=
document.getElementsByTagName(
"
iframe
"
).length;
alert(viewFrameLength)
if (viewFrameLength > 0 )
{
for ( var i = 0 ; i < viewFrameLength; i ++ )
{
var iframeid = document.getElementsByTagName( " iframe " )[i].id;
if (iframeid.indexOf( " KPIListFrame " ) >= 0 )
{
alert(self.frames[iframeid].document.all.HiddenKPI.href);
}
}
}
alert(viewFrameLength)
if (viewFrameLength > 0 )
{
for ( var i = 0 ; i < viewFrameLength; i ++ )
{
var iframeid = document.getElementsByTagName( " iframe " )[i].id;
if (iframeid.indexOf( " KPIListFrame " ) >= 0 )
{
alert(self.frames[iframeid].document.all.HiddenKPI.href);
}
}
}
在iframe内容页中访问父iframe(后面的index也可能不是0):
parent.document.getElementsByTagName(
"
iframe
"
)[
0
]