Home  >  Article  >  php教程  >  <script type="text/html">的使用

<script type="text/html">的使用

WBOY
WBOYOriginal
2016-06-07 11:34:441640browse

做微商城的时候用到这个东东,里面的内容不在页面显示,好奇它有什么用。下面是一个实例,理解的不全,希望大神补刀。
<br> <br>     <meta> <br>     <title>标题</title> <br> <br> <br> <div></div> <br> <input><br> <script><br /> <li><br /> <div class="photo"><br /> <a href="#"> <img src="[UserImg]" / alt="<script type="text/html">的使用" ><br /> <br /> <p><br /> <a href="#">[UserName]:<span class="time">[CreateDate]<br /> </script>


        

    

<script></script>
<script><br /> var reg = new RegExp("\\[([^\\[\\]]*?)\\]",&#039;igm&#039;); //i g m是指分别用于指定区分大小写的匹配、全局匹配和多行匹配。<br /> $("#addFun").click(function() {<br /> var html = document.getElementById("commentTemplate").innerHTML;<br /> var source = html.replace(reg, function(node, key) {<br /> return {<br /> &#039;UserImg&#039; : &#039;1&#039;,<br /> &#039;UserName&#039; : &#039;张&#039;,<br /> &#039;CreateDate&#039; : &#039;2011-1-1&#039;<br /> }[key];<br /> });<br /> $("#comment_ul_2").append(source);<br /> });<br /> var zzl = "name:[name]";<br /> zzl = zzl.replace(reg, function(node, key) {<br /> return {<br /> &#039;name&#039; : &#039;小明&#039;<br /> }[key];<br /> });<br /> alert(zzl);<br /> </script>

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn