使用javascript更改iframe中的onload值
我有一个名为somepage.html的页面,另一个页面otherpage.html作为somepage.html中的iframe somepage.html的源代码是使用javascript更改iframe中的onload值,javascript,html,iframe,onload,Javascript,Html,Iframe,Onload,我有一个名为somepage.html的页面,另一个页面otherpage.html作为somepage.html中的iframe somepage.html的源代码是 <body><iframe src="otherpage.html name="frame"></body> 在IE中,您可以使用security=“restricted”。它不会做您想要的事情(完全禁用javascript),但应该强制IFRAME在不同的区域中运行,并阻止它访问您的页面
<body><iframe src="otherpage.html name="frame"></body>
在IE中,您可以使用security=“restricted”。它不会做您想要的事情(完全禁用javascript),但应该强制IFRAME在不同的区域中运行,并阻止它访问您的页面
HTML5沙盒在实现时,可能也与您想要的内容非常接近。特别地。现在,您只需要在大多数用户的浏览器中实现它;) 别以为这会发生。我认为这是一个比这个评论更好的回答,尽管哈哈。
<body onload="somefunction()" onunload="otherfunction" >the other content here</body>