<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body><IFRAME class=Frame
id=fID_IndexPage style="DISPLAY: none; WIDTH: 100%; HEIGHT: 520px"
src="A.aspx" frameBorder=0 scrolling=no></IFRAME><IFRAME class=Frame
id="awdagv" style="DISPLAY: none; WIDTH: 100%; HEIGHT: 520px"
src="B.aspx" frameBorder=0 scrolling=no></IFRAME><IFRAME
class=Frame id="235tsegt" style="DISPLAY: none; WIDTH: 100%; HEIGHT: 100%"
src="C.aspx" frameBorder=0 scrolling=no></IFRAME>
<IFRAME
class=Frame id="ertye464e" style="WIDTH: 100%; HEIGHT: 100%"
src="D.aspx" frameBorder=0 scrolling=no></IFRAME></body>
</html>
比如C.aspx 怎么知道它的父IFRAME 的id
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body><IFRAME class=Frame
id=fID_IndexPage style="DISPLAY: none; WIDTH: 100%; HEIGHT: 520px"
src="A.aspx" frameBorder=0 scrolling=no></IFRAME><IFRAME class=Frame
id="awdagv" style="DISPLAY: none; WIDTH: 100%; HEIGHT: 520px"
src="B.aspx" frameBorder=0 scrolling=no></IFRAME><IFRAME
class=Frame id="235tsegt" style="DISPLAY: none; WIDTH: 100%; HEIGHT: 100%"
src="C.aspx" frameBorder=0 scrolling=no></IFRAME>
<IFRAME
class=Frame id="ertye464e" style="WIDTH: 100%; HEIGHT: 100%"
src="D.aspx" frameBorder=0 scrolling=no></IFRAME></body>
</html>
比如C.aspx 怎么知道它的父IFRAME 的id
window.onload=function(){
var aFrms = parent.document.getElementsByTagName("IFRAME");
for(i=0;i<aFrms.length;i++){
if(aFrms[i].contentWindow == window){
alert("Id: " + aFrms[i].id);
break;
}
}
}
</script>
<body></body>