日期:2014-05-20  浏览次数:20690 次

读取iframe中的值
mail.asp中包含有一个iframe如: 

<iframe name=xy_userphoto src="upphoto.asp" > </iframe> 

upphoto.asp是: 

  <input name="edu_userphoto" type="text" id="edu_userphoto" value=" <%="2008.jpg"%>"> 

我想在mail.asp中直接获取iframe中的edu_userphoto的值2008.jpg 

在网上搜了一下,好像要使用js来解决,由于自己不知道怎么用js,所以希望得到各位高手的帮助。希望尽量详细一点,谢谢! 

好像用什么

window.framename.getElementById( "控件ID ").value

不知道怎么用

------解决方案--------------------
mail.asp如下

<head>
<script>
function GetDoc(obj)
{
alert(document.frames[obj.id].document.getElementById("edu_userphoto").value);
}
</script>
</head>

<body>
<iframe name=xy_userphoto src="upphoto.jsp" id=xy_userphoto onload="GetDoc(this)"> </iframe>
</body>