读书人

在谷歌中iframe contentDocument的有关

发布时间: 2014-01-17 15:01:00 作者: rapoo

在谷歌中iframe contentDocument的问题
我现在有两个页面,父页面A,子页面B,我要在A页面中执行B也面的button按钮,A页面的JS方法是这样写的:document.getElementById('iframe的ID').contentWindow.document.getElementById('B页面中的buttonID').click();
在IE里面是可以执行的,在FF里面要加上alert才能执行,在Chorme里面加上alert也不能执行。。。。
求高手
[解决办法]
你看看包什么错没 或者直接执行点击button要执行的那个方法
[解决办法]
脚本错了,是window.frames,标准浏览器,document没有frames属性,而且你要阻止a页面表单的提交,要不不一定能执行到到服务器端的代码
OnClientClick="return test();" />




function test() {
window.frames["myiframe"].document.getElementById("asdasdsa").click()
return false////
}

读书人网 >JavaScript

热点推荐