區(qū)別一
xhtml出現(xiàn),js也做了相應(yīng)地改變,標(biāo)簽不再用language地特性.用type特性來(lái)聲明內(nèi)嵌代碼或者要加入外部文件地mime類型.
區(qū)別二
xhtml實(shí)用了cdata代碼段.比如特殊字符 <, > ,& ,不必用他們地字符實(shí)體,而是用代碼
舉例說(shuō)明
<script type = 'text/javascript'>
if(1>2){alert(true!;)}
</script>
但是在xhtml
<script type = 'text/javascript'>
if(1 > 2){alert(true!;)}
</script>
當(dāng)不用代碼標(biāo)識(shí)特殊字符時(shí)用到cdata
<script type = 'text/javascript'>
<![cdata[
if(1>2){alert(true!;)}
]]>
</script>
更多信息請(qǐng)查看IT技術(shù)專欄