pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <tfoot id='KPYRq'></tfoot>

    1. <i id='KPYRq'><tr id='KPYRq'><dt id='KPYRq'><q id='KPYRq'><span id='KPYRq'><b id='KPYRq'><form id='KPYRq'><ins id='KPYRq'></ins><ul id='KPYRq'></ul><sub id='KPYRq'></sub></form><legend id='KPYRq'></legend><bdo id='KPYRq'><pre id='KPYRq'><center id='KPYRq'></center></pre></bdo></b><th id='KPYRq'></th></span></q></dt></tr></i><div class="hnh7zfr" id='KPYRq'><tfoot id='KPYRq'></tfoot><dl id='KPYRq'><fieldset id='KPYRq'></fieldset></dl></div>

      <small id='KPYRq'></small><noframes id='KPYRq'>

        <legend id='KPYRq'><style id='KPYRq'><dir id='KPYRq'><q id='KPYRq'></q></dir></style></legend>
          <bdo id='KPYRq'></bdo><ul id='KPYRq'></ul>

        如何以更好的方式從 ASP 編輯 html?

        How to edit the html from ASP in a better way?(如何以更好的方式從 ASP 編輯 html?)
          <tfoot id='rHp51'></tfoot>
              <bdo id='rHp51'></bdo><ul id='rHp51'></ul>

              • <small id='rHp51'></small><noframes id='rHp51'>

                <i id='rHp51'><tr id='rHp51'><dt id='rHp51'><q id='rHp51'><span id='rHp51'><b id='rHp51'><form id='rHp51'><ins id='rHp51'></ins><ul id='rHp51'></ul><sub id='rHp51'></sub></form><legend id='rHp51'></legend><bdo id='rHp51'><pre id='rHp51'><center id='rHp51'></center></pre></bdo></b><th id='rHp51'></th></span></q></dt></tr></i><div class="bndx5fv" id='rHp51'><tfoot id='rHp51'></tfoot><dl id='rHp51'><fieldset id='rHp51'></fieldset></dl></div>

                    <tbody id='rHp51'></tbody>
                  <legend id='rHp51'><style id='rHp51'><dir id='rHp51'><q id='rHp51'></q></dir></style></legend>
                  本文介紹了如何以更好的方式從 ASP 編輯 html?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  您好,我有一個需要編輯的 ASP 腳本.實際上我需要重新設置它發送的電子郵件的樣式,所以我需要從中編輯 HTML.

                  Hello I have an ASP script that I need to edit. Actually I need to restyle the email that it sends, so I need to edit the HTML from it.

                  問題是html(來自asp文件)在每一行都有

                  The problem is the html (from the asp file) has on every row

                  HTML = HTML & =" 
                  

                  在其中(加上其他一些更改).我需要從該 ASP 中獲取 HTML 代碼,去掉開頭的 html = html 部分,編輯雙 "" 并將它們轉換為單個 " (我需要一一做,因為變量中也有引號).

                  in it (plus some other changes). I need to take the HTML code from that ASP, get rid of the beginning html = html part, edit the double "" and convert them to a single " (I need to do that one by one, because the variables also have quotes in them).

                  然后,我用 HTML 重新設置頁面的樣式,然后我需要將它轉換回來,以便我可以將它集成到 ASP (基本上再次引入雙 '"' 和其他東西).

                  Than, I restyle the page with HTML and after that I need to convert it back so I can integrate it in ASP (basically introduce the double '"' again and stuff).

                  是的,我可以直接從 ASP 編輯 HTML,但我不知道它的外觀,因為我無法運行腳本 (它需要來自服務器的其他文件,我不需要't 有權訪問).

                  Yeah, I could edit the HTML from the ASP directly, but I don't know how it might look, because I can't run the script (it needs other files from the server, which I don't have access to).

                  問題:

                  有更好的方法嗎?

                  某種方式可以直接預覽我在 ASP 中所做的事情.或者也許是一個工具,可以讓我從 ASP HTML 移動到 HTML 并更快地返回.

                  Some way of previewing what I'm doing in ASP directly. Or maybe a tool that let's me move from ASP HTML to HTML and back faster.

                  我當然知道我現在做的很蠢,所以一定有更好的辦法.

                  I sure know that what I'm doing right now is quite dumb, so there must be a better way.

                  推薦答案

                  作為 @steve-holland 提及創建模板是避免代碼中所有煩人的 HTML 字符串并使更改布局變得輕而易舉的好方法.

                  As @steve-holland mentions creating a template is a great way to avoid all the annoying HTML strings in the code and makes changing layouts a breeze.

                  我過去曾自己處理過 HTML 模板腳本,通常我會構建一個 Scripting.Dictionary,其中包含我將在模板中替換的鍵值對.

                  I've worked on HTML templating scripts myself in the past, usually I build a Scripting.Dictionary that contains the key value pairs I will be replacing inside the template.

                  Function getHTMLTemplate(url, params)
                    Dim stream, keys, html, idx
                  
                    Set stream = Server.CreateObject("ADODB.Stream")
                    With stream
                      .Type = adTypeText
                      .Charset = "utf-8"
                      Call .Open()
                      Call .LoadFromFile(url)
                      html = .ReadText(adReadAll)
                      Call .Close()
                    End With
                    Set stream = Nothing
                  
                    keys = o_params.Keys
                    For idx = 0 To UBound(keys, 1)
                      html = Replace(html, keys(idx), params.Item(keys(idx)))
                    Next
                    Set keys = Nothing
                    Set params = Nothing
                  
                    getHTMLTemplate = html
                  End Function
                  

                  用法:

                  Dim params, html
                  Set params = Server.CreateObject("Scripting.Dictionary")
                  With params
                    .Add("[html_title]", "Title Here")
                    .Add("[html_logo]", "/images/logo.gif")
                    '... and so on
                  End With
                  
                  html = getHTMLTemplate(Server.MapPath("/templates/main.htm"), params)
                  
                  Call Response.Write(html)
                  

                  示例main.htm結構:

                  <!doctype html>
                  <html>
                    <head>
                      <title>[html_title]</title>
                      <link rel="stylesheet" type="text/css" href="/styles/main.css" />
                    </head>
                  
                    <body>
                      <div class="header">
                        <img src="[html_logo]" alt="Company Name" />
                      </div>
                    </body>
                  </html>
                  

                  為什么使用 ADODB.Stream 而不是 Scripting.FileSystemObject?;

                  Why use a ADODB.Stream instead of the Scripting.FileSystemObject?;

                  1. 您可以控制返回的 Charset,如果需要,甚至可以從一個字符集轉換為另一個字符集.

                  1. You can control the Charset being returned and even convert from one to another if you need to.

                  如果模板特別大,您可以使用 Read() 方法以特定的緩沖區大小將內容流式傳輸,以提高讀取的性能.

                  If the template is particular large, you can stream the content in using the Read() method with a specific buffer size to improve the performance of the read.

                  這篇關于如何以更好的方式從 ASP 編輯 html?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  document.write() overwriting the document?(document.write() 覆蓋文檔?)
                  AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https(AngularJS 錯誤:跨源請求僅支持協議方案:http、data、chrome-extension、https) - IT屋-程序員軟件開發技術分
                  IE10 and Cross-origin resource sharing (CORS) issues with Image / Canvas(IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題)
                  Importing script with type=module from local folder causes a CORS issue(從本地文件夾導入 type=module 的腳本會導致 CORS 問題)
                  HTML crossorigin attribute for img tag(img 標簽的 HTML 跨域屬性)
                  <legend id='1Neba'><style id='1Neba'><dir id='1Neba'><q id='1Neba'></q></dir></style></legend>
                    <tbody id='1Neba'></tbody>

                      • <i id='1Neba'><tr id='1Neba'><dt id='1Neba'><q id='1Neba'><span id='1Neba'><b id='1Neba'><form id='1Neba'><ins id='1Neba'></ins><ul id='1Neba'></ul><sub id='1Neba'></sub></form><legend id='1Neba'></legend><bdo id='1Neba'><pre id='1Neba'><center id='1Neba'></center></pre></bdo></b><th id='1Neba'></th></span></q></dt></tr></i><div class="jbh9rlv" id='1Neba'><tfoot id='1Neba'></tfoot><dl id='1Neba'><fieldset id='1Neba'></fieldset></dl></div>
                            <bdo id='1Neba'></bdo><ul id='1Neba'></ul>

                            <small id='1Neba'></small><noframes id='1Neba'>

                          • <tfoot id='1Neba'></tfoot>

                            主站蜘蛛池模板: 一路商机网-品牌招商加盟优选平台-加盟店排行榜平台 | 岩棉板|岩棉复合板|聚氨酯夹芯板|岩棉夹芯板|彩钢夹芯板-江苏恒海钢结构 | 钢格板|镀锌钢格板|热镀锌钢格板|格栅板|钢格板|钢格栅板|热浸锌钢格板|平台钢格板|镀锌钢格栅板|热镀锌钢格栅板|平台钢格栅板|不锈钢钢格栅板 - 专业钢格板厂家 | 工业电炉,台车式电炉_厂家-淄博申华工业电炉有限公司 | 叉车电池-叉车电瓶-叉车蓄电池-铅酸蓄电池-电动叉车蓄电池生产厂家 | 通用磨耗试验机-QUV耐候试验机|久宏实业百科| 匀胶机旋涂仪-声扫显微镜-工业水浸超声-安赛斯(北京)科技有限公司 | LHH药品稳定性试验箱-BPS系列恒温恒湿箱-意大利超低温冰箱-上海一恒科学仪器有限公司 | 安平县鑫川金属丝网制品有限公司,声屏障,高速声屏障,百叶孔声屏障,大弧形声屏障,凹凸穿孔声屏障,铁路声屏障,顶部弧形声屏障,玻璃钢吸音板 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 艺术涂料_进口艺术涂料_艺术涂料加盟_艺术涂料十大品牌 -英国蒙太奇艺术涂料 | 锂辉石检测仪器,水泥成分快速分析仪-湘潭宇科分析仪器有限公司 | 深圳市八百通智能技术有限公司官方网站 | 自清洗过滤器,浅层砂过滤器,叠片过滤器厂家-新乡市宇清净化 | 校园文化空间设计-数字化|中医文化空间设计-党建|法治廉政主题文化空间施工-山东锐尚文化传播公司 | 电伴热系统施工_仪表电伴热保温箱厂家_沃安电伴热管缆工业技术(济南)有限公司 | 全自动翻转振荡器-浸出式水平振荡器厂家-土壤干燥箱价格-常州普天仪器 | 行星齿轮减速机,减速机厂家,山东减速机-淄博兴江机械制造 | 国产液相色谱仪-超高效液相色谱仪厂家-上海伍丰科学仪器有限公司 | YAGEO国巨电容|贴片电阻|电容价格|三星代理商-深圳市巨优电子有限公司 | 至顶网 | 软文世界-软文推广-软文营销-新闻稿发布-一站式软文自助发稿平台 | led太阳能路灯厂家价格_风光互补庭院灯_农村市政工程路灯-中山华可路灯品牌 | 上海橡胶接头_弹簧减震器_金属软接头厂家-上海淞江集团 | 一体化净水器_一体化净水设备_一体化水处理设备-江苏旭浩鑫环保科技有限公司 | 北京网站建设|北京网站开发|北京网站设计|高端做网站公司 | 电池挤压试验机-自行车喷淋-车辆碾压试验装置-深圳德迈盛测控设备有限公司 | 石英陶瓷,石英坩埚,二氧化硅陶瓷-淄博百特高新材料有限公司 | 锂电池生产厂家-电动自行车航模无人机锂电池定制-世豹新能源 | 壹车网 | 第一时间提供新车_资讯_报价_图片_排行! | 快速门厂家-快速卷帘门-工业快速门-硬质快速门-西朗门业 | 纸布|钩编布|钩针布|纸草布-莱州佳源工艺纸布厂 | 流量检测仪-气密性检测装置-密封性试验仪-东莞市奥图自动化科技有限公司 | 小区健身器材_户外健身器材_室外健身器材_公园健身路径-沧州浩然体育器材有限公司 | 亿立分板机_曲线_锯片式_走刀_在线式全自动_铣刀_在线V槽分板机-杭州亿协智能装备有限公司 | 馋嘴餐饮网_餐饮加盟店火爆好项目_餐饮连锁品牌加盟指南创业平台 | 圆盘鞋底注塑机_连帮鞋底成型注塑机-温州天钢机械有限公司 | 蔬菜配送公司|蔬菜配送中心|食材配送|饭堂配送|食堂配送-首宏公司 | 中红外QCL激光器-其他连续-半导体连续激光器-筱晓光子 | 河南凯邦机械制造有限公司| 江苏远邦专注皮带秤,高精度皮带秤,电子皮带秤研发生产 |