textarea的value是html文件源代码,如何把源代码存成html文件??
如
hmtl页面 alert(ok);
1楼
dim fileNameStr
fileNameStr = Trim(Request.Form("fileName"))
dim fileContentStr
fileContentStr = Trim(Request.Form("fileContent"))
Set fs = CreateObject("Scripting.FileSystemObject")
dim filePath
filePath = Server.MapPath("PageURL/" & fileNameStr)
Set a = fs.CreateTextFile(filePath, True)
a.WriteLine(fileContentStr)
a.Close
2楼
在客户端实现保存的方法:
<script> <BR> <!-- <BR> function Save() <BR> { <BR> var txt = document.all.mm; <BR> var ww = window.open("", "_blank", "width=100px, height=100px"); <BR> ww.document.write(txt.value); <BR> ww.document.close(); <BR> ww.document.execCommand('SaveAs'); <BR> //ww.document.execCommand('Saveas',false,'c:\\test.htm'); <BR> ww.close(); <BR> } <BR> //--> <BR> </script>