A demo on the first, simple rude, please help yourself
<!DOCTYPE HTML><HTML><HeadLang= "en"> <MetaCharSet= "UTF-8"> <title></title> <style> *{margin:0px;padding:0px; } </style> <Scriptsrc= "Http://code.jquery.com/jquery-1.11.3.min.js"></Script></Head><Body><Scripttype= "Text/template"ID= "Unit_temple">
Here's the template .<Div>Hello</div></Script><DivID= "Content">Hi</Div><Scripttype= "Text/javascript"> $("#content"). HTML ($ ("#Unit_temple "). HTML ());</Script></Body></HTML>
Here defines a rendering template, in the initial look at the HTML <script> tag type attribute only see the following values, fixed thinking can only use the following values, in fact, the value of type can be changed, as the above demo,
<Type= "text/template" id= "unit_temple">
Grammar<Scripttype= "value">The property value value describes the Mime_type MIME type. Some of these values: text/JavaScripttext/ECMAScriptApplication/ECMAScriptApplication/JavaScripttext/VBScript
Why the script tag here, the advantage of using the script tag is not displayed on the page by default, and can be placed in addition to all tags except the script tag, the template generally does not appear scrtipt tags, summary is the script tag type can be arbitrarily defined, But to see what is supported, such as the jsx used by react, is text/jsx.
The little things about MVC template rendering type= "Text/template"