textarea的value是html文件源代码,存成html文件的代码_Javascript教程-查字典教程网
textarea的value是html文件源代码,存成html文件的代码
textarea的value是html文件源代码,存成html文件的代码
发布时间:2016-12-30 来源:查字典编辑
摘要:textarea的value是html文件源代码,如何把源代码存成html文件??如hmtl页面alert(ok);1楼dimfileNam...

textarea的value是html文件源代码,如何把源代码存成html文件??

<html>

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">

<title>hmtl页面</title>

</head>

<body>

alert(ok);

</body>

</html>

1楼

dimfileNameStr

fileNameStr=Trim(Request.Form("fileName"))

dimfileContentStr

fileContentStr=Trim(Request.Form("fileContent"))

Setfs=CreateObject("Scripting.FileSystemObject")

dimfilePath

filePath=Server.MapPath("PageURL/"&fileNameStr)

Seta=fs.CreateTextFile(filePath,True)

a.WriteLine(fileContentStr)

a.Close

2楼

在客户端实现保存的方法:

<textareaid=mmrows=8>

<html>

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">

<title>hmtl页面</title>

</head>

<body>

alert(ok);

</body>

</html>

</textarea><br>

<inputtype=buttonvalue=saveonclick="Save()">

<SCRIPTLANGUAGE="JavaScript">

<>

</SCRIPT>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类