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