Introduce files. js introduces js files.
Another important purpose of the chtml/ChinaHtml tag is to introduce files, similar to <% @ include file = "file-url" %> in jsp, <! -- # Include file = "wisdom. inc" -->, and <? Php include 'menu. php';?>
Usage: <chtml file = file Name> </chtml>. A file name is a file name containing a relative path in the WebEasy system directory (D:/webeasy /).
Example:
<pre name="code" class="html">
Effect:
(Example file: _ samples/import.html)
Let's look at the application in actual development:
Open B2C e-commerce web site (Free Download: http://download.csdn.net/detail/tx18/8318585) HomeIndex.htmlFile
<HTML> <HEAD> <chtml> <bag id = pPage> <we name = title> </we> <we name = Description> </we> </bag> </chtml> <chtml file = "htm/head _ @ {head: client).htm "/> <! -- Determine whether to modify --> <chtml> <Bag id = sys> <we name = NodeID> c0.0 </we> </Bag> </chtml> <! -- Topic node --> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file --> </HEAD> <BODY leftMargin = 0 topMargin = 0 MARGINWIDTH = "0" MARGINHEIGHT = "0"> <chtml file = "htm/top.htm "/> <TABLE cellSpacing = 0 cellPadding = 0 width = "974" align = center border = 0> <TR> <TD> <chtml file = "htm/index_c.htm"/> <chtml file = "htm/index_c1.htm"/> </TD> </TR> </TABLE> <script Language = "JavaScript"> // record the number of clicks function visit_show (id) {if (xmlHttpReq = null) xmlHttpReq = AB. getXmlHttp (); xmlHttpReq. ope N ("GET", "@ {sys: path} site/eb/sale_visit.xml? We_id = "+ id, true); xmlHttpReq. setRequestHeader ("cache-control", "no-cache"); xmlHttpReq. send (null) ;}</script> <chtml file = "htm/foot.htm"/> </BODY> </HTML>
Five files are introduced from top to bottom, with
Htm/index_c.htmFor example:
<TABLE cellSpacing = 0 cellPadding = 0 border = 0 width = "100%"> <TR> <TD width = "730" rowspan = 8 valign = top> <chtml file = "htm /img_play.htm "/> </TD> <TD width = 6 rowspan = 8> </TD> <TD width =" 236 "class = tablehead width =" 100% "height = 25> <A class = tab_head href = "@ {sys: path} site/list.html? M = 2 & s = 4 "> industry news </A> </TD> </TR> <TD width =" 100% "height = 222 vAlign = top class = border1> <chtml> <esql module = "base" id = "list"> Select we_id, title from base_info order by we_id desc limit 5 </esql> <for bags = list end = "@ {list: getLength}"> <div style = "padding-top: 6px; padding-left: 5px; height: 18px "> <a href =" @ {sys: path} site/show.html? Myid = @ {list: we_id} "title =" @ {list: title} "target = _ blank >@{ intLeft :@{ list: title} (17 )} </a> </div> </for> </chtml> </TD> </TR> <tr> <td height = 6> </td> </tr> <TR> <TD class = tablehead width = "100%" height = 25> <A class = tab_head href = "#"> today's special offer </A> </TD> </TR> <TD width = "100%" height = 204 vAlign = top class = border1> <chtml> <esql module = "base" id = "list"> Select NAME, IMG_URL, LINK from images_base where catalog = 2 order by WE_ID desc limit 1 </esql> <if x = "@ {list: getLength} "else = 1> <we x = 0/> <div align = center style =" padding-top: 6px; "> <A href =" @ {list: LINK} "target = _ blank title =" @ {list: NAME} "> </A> </div> </if> </chtml> </TD> </TR> </TABLE>
Htm/img_play.htm is introduced in index_c.htm, which is used to play pictures from the perspective of name. The following shows the industry news and the query and display of today's special prices.
Effect:
Release more resultsLight B2C e-commerce websites
Download and description of light platform Resources
Platform free download: http://download.csdn.net/detail/tx18/8381859
Latest Development Manual download: http://download.csdn.net/detail/tx18/8411089
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please pay attention to the latestDevelopment Manual