首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

点击一个按钮,触发iframe里的一个上传按钮的onclick事件弹出选择文件对话框解决办法

2012-03-05 
点击一个按钮,触发iframe里的一个上传按钮的onclick事件弹出选择文件对话框A.htm页面的代码:inputtype

点击一个按钮,触发iframe里的一个上传按钮的onclick事件弹出选择文件对话框
A.htm页面的代码:

<input   type= "button "   onclick= "upimgs.getElementsByName( 'file ').item(0).click(); ">
<iframe   ID= "upimgs "   src= "B.htm "   frameborder= "0 "   scrolling= "no "   width= "100% "   HEIGHT= "25 "> </iframe>

B.htm页面的代码:

<input   type= "file "   name= "file ">

我现在想在A页面点击button弹出B页面的选择文件列表框,请大大门看下如何实现

[解决办法]
不可~
安全性限制
[解决办法]
只有IE可以,其他浏览器不行
<iframe name= "iframe1 " src= "1.htm "> </iframe>
<script language=javascript defer>
function show()
{
iframe1.document.getElementById( "file1 ").click()
}
</script>
<input name= "haha " type= "button " onclick=show()>
[解决办法]
这样做没什么意义
[解决办法]
<input type= "button " onclick= "frames[ "upimgs "].document.getElementsByName( 'file ')[0].click(); ">

热点排行