|
本帖最后由 chishingchan 于 2019-6-11 08:10 编辑
系统:XP SP3 简体中文专业版
浏览器:IE8
modaldialog.hta
- <html>
- <head>
- <title>模态对话框</title>
- <HTA:APPLICATION
- APPLICATIONNAME="ModalDialog">
- </head>
- <script language="VBScript">
- Sub CloseWindow
- window.returnValue = listbox.Value
- window.Close
- End Sub
- </script>
- <body>
- <select size="3" name="listbox">
- <option value="1">选项 1</option>
- <option value="2">选项 2</option>
- <option value="3">选项 3</option>
- <option value="4">选项 4</option>
- </select>
- <p>
- <input type="button" id="idBtn" value="确定" onclick="CloseWindow">
- </body>
- </html>
复制代码
运行后可以显示窗口,但当点击“确定”按钮后就出错,请问如何解决?谢谢!
刚才发现,原来这个 HTA 是被调用的:
- <html>
- <head>
- <title>Modal Example</title>
- <HTA:APPLICATION
- APPLICATIONNAME="MainModal">
- </head>
- <script language="VBScript">
- Sub ShowDialog
- intReturn = ShowModalDialog("modaldialog.hta")
- textbox.Value = intReturn
- End Sub
- </script>
- <body>
- <button onclick="ShowDialog">
- Show Dialog Box</button> <p>
- <input type="text" name="textbox">
- </body>
- </html>
复制代码 |
|