谁能帮我解决这问题,100分!!!!!!不够分可以再加!
hllcn 2004-11-05 02:56:42 有这三个文件
index.html ---> http://localhost/index.html;
myhtc.htc ---> http://localhost/myhtc.htc;
mypage.aspx ---> http://localhost/mypage.aspx;
在index.html里嵌入myhtc组件.
在myhtc组件里,有个iframe,嵌入了mypage.aspx;
在mypage.aspx里有个TextBox,name="mytext" value = "123456789";
问题。在index.html页面显示了,想在index 下调用myhtc组件里的一个方法。而该方法返回iframe页面里的TextBox的值。我试了好多次,总得不到.能实现么?怎么实现?请给于例子说明。如果不能实现,请给出别一种方法.
index.html文件里:
<script language="javascript">
var vv = myhtc.getvalue();
</script>
<html xmlns:Test="my.com.cn">
<body>
<?IMPORT NAMESPACE="Test" IMPLEMENTATION="myhtc.htc">
<Test:myhtc id="myhtc" >
</Test:myhtc>
</body>
</html>
-------------------------------------------------------------------------
myhtc.htc文件里:
<script language="javascript">
function getvalue()
{
return myframe.document.myform.mytext.value;
}
</script>
<IFRAME id="myframe" name = "myframe" src="mypage.aspx"></IFRAME>
-------------------------------------------------------------------------
mypage.aspx文件里:
<body>
<form id="myform">
<input type="text" name="mytext" value="123456789">
</form>
</body>
谢谢~