The little things about MVC template rendering type= "Text/template"

Source: Internet
Author: User
Tags script tag

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.