IFrame事件在HTML中执行良好,但在HTA中不执行
单击iframe内的按钮时,此HTML文件显示消息对话框:IFrame事件在HTML中执行良好,但在HTA中不执行,html,vbscript,hta,Html,Vbscript,Hta,单击iframe内的按钮时,此HTML文件显示消息对话框: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script language="VBScript" type="text/vbscript"> Sub load_me() frame.document.write "<input t
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="VBScript" type="text/vbscript">
Sub load_me()
frame.document.write "<input type='button' onclick='parent.message()'>"
End Sub
Sub message()
MsgBox "Hi"
End Sub
</script>
</head>
<body>
<iframe id="frame" onload="load_me"></iframe>
</body>
</html>
为什么会这样,或者如何从HTA中的iframe按钮单击事件执行父函数?使用:
<iframe id="frame" onload="load_me" application="yes"></iframe>
请参见第节《信任的力量:HTA和安全》
<iframe id="frame" onload="load_me" application="yes"></iframe>