<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="Author" content="cuixiao">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>-</title>
<link href="../CommonComponent/Style/Style1.css" rel="stylesheet" type="text/css">
<script src="../CommonTheme/Javascript/display.js"></script>
</head>
<body class="pad1">
<input type="button" onclick="document.styleSheets[0].href=''document.execCommand('saveas',false,'c:\aaa.htm');" value="另存为">
</body>
</html>
<html>
<head>
<meta name="Author" content="cuixiao">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>-</title>
<link href="../CommonComponent/Style/Style1.css" rel="stylesheet" type="text/css">
<script src="../CommonTheme/Javascript/display.js"></script>
</head>
<body class="pad1">
<input type="button" onclick="document.styleSheets[0].href=''document.execCommand('saveas',false,'c:\aaa.htm');" value="另存为">
</body>
</html>
解决方案 »
- window.showModalDialog打开调用父窗口方法的问题
- 这段代码如何正常显示html代码
- 求助 请问JavaScript中 如何通过给定的URL来获得该页面的源代码?
- 我的第一个dwr,出错了。
- firefox夸域无法调用window.parent的问题
- js的location重定向问题
- 想写一个脚本函数来判断是不是移动的手机号码
- 请问各路高手,如何使某一组radio恢复成未选状态
- Select中的列表文字左边能否是复选框?up者有分
- 怎么在用window.close()关闭IE窗口时不出提示??
- 如何在html文档里使用Javascipt里定义的变量?
- javascript如何接收地址栏(url)中所传的参数
如果打开一个页面后把网线拔了,再去保存该网页仍然保存成功。
IE保存文件大部分是从Internet临时文件夹中获取的
如果清除临时文件夹中的文件,然后执行文件另存为
文件还是可以保存,但是里边只是仅有的几行信息,没有实质性的内容
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function saveAs(){
// var winSave = window.open('','','top=5000,left=5000');
var winSave = window.open();
winSave.document.open ("text/html","gb2312");
winSave.document.write (document.body.outerHTML);
winSave.document.execCommand ("SaveAs",true,"aaa.htm");
winSave.close();
}
//-->
</SCRIPT>
</head>
<body><A HREF="http://www.csdn.net" id="a1">csdn</A>
<input type="button" value="另存为" onclick="saveAs()">
<input type="button" value="替换连接" onclick="javascript:a1.href='#'">
</body>
</html>