Asp.net 是否可以从iframe访问驻留在脚本文件中的javascript

Asp.net 是否可以从iframe访问驻留在脚本文件中的javascript,asp.net,html,iframe,Asp.net,Html,Iframe,我想使用iframe从另一个页面访问驻留在脚本文件中的javascript函数。 我的示例代码: 需要从中访问javascript的页面 <iframe id="FRAMESET" src="default.htm" width="0%" height="0%"> <p> Your browser does not support iframes. </p> </iframe> 我

我想使用iframe从另一个页面访问驻留在脚本文件中的javascript函数。 我的示例代码:

需要从中访问javascript的页面

 <iframe id="FRAMESET" src="default.htm" width="0%" height="0%">
        <p>
            Your browser does not support iframes.
        </p>
    </iframe>

我想在主页上访问此功能。我尝试了document.getElementById('FRAMESET').contentWindow.helloWorld();但给我的错误是“那个document.getElementById('FRAMESET').contentWindow.helloWorld();”不是一个函数。

这是不可能的。所有浏览器(IE、FF、Chrome)现在都阻止js访问iframe内容。为什么不直接将main.js加载到主页中?

这是可能的。您可以在包含框架的页面中执行此操作:

document.getElementById('FRAMESET').contentWindow.helloWorld();

实际上,您可以访问iframe内容,只要iframe位于同一个域中。thanx用于快速回复。我尝试了这个方法,但不起作用。它给了我document.getElementById('FRAMESET').contentWindow.helloWorld();这不是一个函数
function helloWorld() {
    alert("hello World");
}
document.getElementById('FRAMESET').contentWindow.helloWorld();