<HTML>
2<HEAD>
3 <script language="JavaScript">
4 function openFile() {
5 var of= new ActiveXObject("MSComDlg.CommonDialog");
6 //fd.Filter = "图片文件l(*.jpg|*.jpg";
7 of.Filter = "*.*";
8 of.FilterIndex = 2;
9 // must setting
10 of.MaxFileSize = 128;
11 of.ShowSave();//显示保存按钮
of.ShowOpen();//显示打开按钮
12 }
13</script>
14</HEAD>
15<BODY>
16 <TABLE>
17 <TR>
18 <TD>
19 <input type="button" value="open" onclick="openFile()" >
20 </TD>
21 </TR>
22 </TABLE>
23</BODY>
24</HTML>