index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<title>标题</title>
<script src="../webjs/j.js" type="text/javascript"></script>
<script>
$(function(){
 alert($(window.frames["midFrame"].document).find("img").attr("src"));
})
</script>
</head>
<frameset rows="130,*" cols="*" frameborder="no" border="0" framespacing="0">
  <frame src="topframe.html" name="topFrame" frameborder="no" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frameset id="myFrame" name="myFrame" cols="199,10" frameborder="no" border="0" framespacing="0">
    <frame src="leftframe.php" name="leftFrame" frameborder="no" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="switchframe.html" name="midFrame" frameborder="no" scrolling="No" noresize="noresize" id="midFrame" title="midFrame" />
  </frameset>
</frameset>
<noframes>
<body></body>
</noframes>
</html>switchframe.html
<!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" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<title>显示/隐藏左侧导航栏</title></head><body>
<div id="switchpic"><img src="images/switch_left.gif" alt="隐藏左侧导航栏" id="ImgArrow" /></div>
</body>
</html>
我想要在主窗口中弹出switchframe.html里的图片的路径
运行结果为undefind,我也改过$('#midFrame').contents().find("img") 也不行请大家看看我错在哪了