js怎样打开保存文档的对话框

surewang 2003-10-18 10:35:48
请问用js 怎样打开保存文档的对话框就像wk.SaveFileDialog一样
...全文
117 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
surewang 2003-10-18
  • 打赏
  • 举报
回复
to gjd111686(数字金刚)
能再详细点么?最好有点代码,多谢了
gjd111686 2003-10-18
  • 打赏
  • 举报
回复
就是它了,引用的Object的clsild是一个.调用方法不同而已.
也可以直接调用WebBrowse控件的Exec(IE菜单列1,IE菜单行6)就可以.
YuLimin 2003-10-18
  • 打赏
  • 举报
回复
<html>

<head>
<title>保存文件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="pragma" content="no-cache">
<script>
<!--
function saveHTMLFile(strFileName)
{
document.execCommand('saveas','true',strFileName + '.htm');
}
function saveTXTFile(strFileName)
{
document.execCommand('saveas','true',strFileName + '.txt');
}
function getSelectInfo()
{
alert('你所选的内容是:\n');
alert(document.getSelection());
}
//-->
</script>
</head>

<body>
<center>这是一个文件<p>
<INPUT TYPE="BUTTON" NAME="getstring" VALUE="得到所选信息" onClick="getSelectInfo()">
<input type=button value=另存为htm onclick="saveHTMLFile('Content')">
<input type=button value=另存为txt onclick="saveTXTFile('Content')">
<input type=button value=另存为txt onclick="document.execCommand('saveas','true','Content.txt')">
<p>测试<p>
</center>
</body>
</html>

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧