jquery – CDATA的意思是什麼
大師,
我自學.有很多你開明的人稱之為基本我什麼都不瞭解.
讀這個jQuery_For_Designers" rel="nofollow,noindex" target="_blank">jQuery Tutorial ,我注意到這個標籤(缺乏更好的詞):“CDATA”如下所示(第三行從頂部):
<script src="http://jquery.com/src/jquery-latest.js"></script> <script> //<![CDATA[ $(document).ready(function(){ $(".article .thebody").hide(); $("#container .article ul") .prepend("<li class='readbody'><a href='' title='Read the article'>Read Body</a></li>"); $(".actions li.readbody a").click(function(event){ $(this).parents("ul").prev(".thebody").toggle(); event.preventDefault(); }); }); //]]></script>
CDATA的意思是什麼?有與CDATA類似的標籤嗎?
使用<![CDATA [您可以JavaScript_for_XHTML" rel="nofollow,noindex" target="_blank">embed JS in XML (and XHTML) documents 而不需要像XML實體& gt;& gt;& amp; amp; amp; amp; amp; amp;等等,以防止XML語法錯誤,並且您會收到像The entity name must immediately follow the ‘&’ in the entity reference 這樣的錯誤.然而,一般建議將JS程式碼放在自己的.js檔案中,然後由<script src> ;.包含.<![CDATA [在純HTML文件中不需要.除非您使用像Facelets (針對JSF)或ASP.NET MVC的基於XML的檢視技術開發,否則絕對不需要將您的HTML宣告為XHTML .只是一個<!DOCTYPE html>就夠了
http://stackoverflow.com/questions/4339702/what-is-the-meaning-of-cdata