色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

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

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");   
      ww.document.write(txt.value);   
      ww.document.close();   
      ww.document.execCommand('SaveAs');   
      //ww.document.execCommand('Saveas',false,'c://test.htm');   
      ww.close();   
  }   
  //-->   
  </SCRIPT>

JavaScript技術textarea的value是html文件源代碼,存成html文件的代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 中西区| 松阳县| 六枝特区| 平利县| 阳朔县| 青岛市| 垣曲县| 沙河市| 如皋市| 商水县| 武夷山市| 兴国县| 昂仁县| 邵阳市| 莲花县| 浙江省| 张北县| 平武县| 千阳县| 垦利县| 三台县| 那曲县| 平遥县| 民丰县| 南城县| 满城县| 晋城| 法库县| 宁陵县| 界首市| 淮阳县| 丰城市| 张家口市| 固阳县| 刚察县| 光山县| 平阴县| 英德市| 凤翔县| 涟水县| 青铜峡市|