jquery – CDATA的意思是什么

栏目: jQuery · 发布时间: 7年前

内容简介:使用<![CDATA [您可以http://stackoverflow.com/questions/4339702/what-is-the-meaning-of-cdata

大师,

我自学.有很多你开明的人称之为基本我什么都不了解.

读这个 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 [您可以 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&gt ;.包含.<![CDATA [在纯HTML文档中不需要.除非您使用像 Facelets (针对JSF)或ASP.NET MVC的基于XML的视图技术开发,否则绝对不需要将您的HTML声明为 XHTML .只是一个<!DOCTYPE html>就够了

http://stackoverflow.com/questions/4339702/what-is-the-meaning-of-cdata


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web Design in a Nutshell

Web Design in a Nutshell

Jennifer Niederst / O'Reilly Media, Inc. / 2006-02-21 / USD 34.99

Are you still designing web sites like it's 1999? If so, you're in for a surprise. Since the last edition of this book appeared five years ago, there has been a major climate change with regard to web......一起来看看 《Web Design in a Nutshell》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换