色尼玛亚洲综合影院,亚洲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頁(yè)面</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樓
在客戶端實(shí)現(xiàn)保存的方法:   
  <textarea   id=mm   style="width:   500"   rows=8>   
  <html>   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>hmtl頁(yè)面</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技術(shù)textarea的value是html文件源代碼,存成html文件的代碼,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 盐山县| 南靖县| 通道| 铜山县| 华阴市| 富蕴县| 昭觉县| 阳新县| 哈巴河县| 林周县| 招远市| 乌拉特后旗| 寻甸| 浙江省| 竹山县| 天等县| 玉门市| 左云县| 江阴市| 朝阳县| 新干县| 南京市| 黄梅县| 海门市| 涞水县| 独山县| 罗江县| 安乡县| 新绛县| 天镇县| 广宁县| 台湾省| 正定县| 土默特右旗| 泗水县| 宣汉县| 丹棱县| 通海县| 灌阳县| 南木林县| 丰原市|