国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

textarea的value是html文件源代碼,存成html文件的代碼

2024-09-06 12:42:35
字體:
來源:轉載
供稿:網友
textarea的value是html文件源代碼,如何把源代碼存成html文件??   
  如   
  <html>   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>hmtl頁面</title>   
  </head>   
  <body>   
      alert(ok);   
  </body>   
  </html>   

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樓
在客戶端實現保存的方法:   
  <textarea   id=mm   style="width:   500"   rows=8>   
  <html>   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>hmtl頁面</title>   
  </head>   
  <body>   
      alert(ok);   
  </body>   
  </html>   
  </textarea><br>   
  <input   type=button   value=save   onclick="Save()">   
  <SCRIPT   LANGUAGE="JavaScript">   
  <!--   
  function   Save()   
  {   
      var   txt   =   document.all.mm;   
      var   ww     =   window.open("",   "_blank",   "width=100px,   height=100px");   
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石家庄市| 遂溪县| 房产| 恩施市| 临沂市| 广安市| 江陵县| 浙江省| 大渡口区| 会宁县| 防城港市| 通辽市| 海盐县| 天等县| 孟津县| 张家界市| 鹤庆县| 白朗县| 曲松县| 靖边县| 钦州市| 长葛市| 乌兰县| 西昌市| 平泉县| 宁都县| 新津县| 嵊泗县| 密云县| 蒙城县| 鹤峰县| 通化市| 霞浦县| 宣城市| 上犹县| 鄂托克旗| 永善县| 梅河口市| 西和县| 全南县| 甘洛县|