jquery – CDATA的意思是什么

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

内容简介:使用<![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


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

查看所有标签

猜你喜欢:

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

HTTP Essentials

HTTP Essentials

Stephen A. Thomas、Stephen Thomas / Wiley / 2001-03-08 / USD 34.99

The first complete reference guide to the essential Web protocol As applications and services converge and Web technologies not only assume HTTP but require developers to manipulate it, it is be......一起来看看 《HTTP Essentials》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具