javascript CDATAµÄÒâÒå
CDATA ÄÚ²¿µÄËùÓж«Î÷¶¼»á±»½âÎöÆ÷ºöÂÔ¡£
¼ÙÈçÎı¾Öаüº¬ÁË´óÁ¿µÄ "<" ºÍ "&" ×Ö·û - ¾ÍÏñ±à³Ì´úÂëÖо³£³öÏÖµÄÇé¿öÒ»Ñù - ÄÇôÕâ¸ö XML ÔªËؾͿÉÒÔ±»¶¨ÒåΪһ¸ö CDATA ²¿·Ö¡£
CDATA Çø¶Î¿ªÊ¼ÓÚ "<![CDATA["£¬½áÊøÓÚ "]]>"£º
<script type="text/javascript">
<![CDATA[
function compare(a,b)
{
if (a < b)
{alert("aСÓÚb");}
else if (a>b)
{alert("a´óÓÚb");}
else
{alert("aµÈÓÚb");}
}
]]>
</script>
ÔÚÉÏÃæµÄÀý×ÓÖУ¬ÔÚ CDATA Çø¶ÎÖеÄËùÓж«Î÷¶¼»á±»½âÎöÆ÷ºöÂÔ¡£
¹ØÓÚ CDATA Çø¶ÎµÄ×¢ÊÍ:
CDATA Çø¶Î²»ÄÜ°üº¬×Ö·û´® "]]>"£¬ËùÒÔ£¬CDATA Çø¶ÎµÄǶÌ×ÊDz»±»ÔÊÐíµÄ¡£
ͬʱҲÐèҪȷ±£ÔÚ "]]>" ×Ö·û´®ÖÐûÓпոñ»òÕÛÐС£
ΪʲôҪʹÓÃCDATA:
XHTMLµÄµÚ¶þ¸ö¸Ä±äÊÇʹÓÃCDATA¶Î¡£XMLÖеÄCDATA¶ÎÓÃÓÚÉùÃ÷²»Ó¦±»½âÎöΪ±êÇ©µÄÎı¾£¨XHTMLÒ²ÊÇÈç´Ë£©£¬ÕâÑù¾Í¿ÉÒÔʹÓÃÌØÊâ×Ö·û£¬ÈçСÓÚ£¨<£©¡¢´óÓÚ£¨>£©¡¢ºÍºÅ£¨&£©ºÍË«ÒýºÅ£¨"£©£¬¶ø²»±ØʹÓÃËüÃǵÄ×Ö·ûʵÌå¡£¿¼ÂÇÏÂÃæµÄ´úÂ룺
<script type="text/javascript">
function compare(a,b)
{
if (a < b)
{alert("aСÓÚb");}
else if (a>b)
{alert("a´óÓÚb");}
else
{alert("aµÈÓÚb");}
}
</script>
Õâ¸öº¯ÊýÏ൱¼òµ¥£¬Ëü±È½ÏÊý×ÖaºÍb£¬È»ºóÏÔʾÏûϢ˵Ã÷ËüÃǵĹØϵ¡£µ«ÊÇ£¬ÔÚXHTMLÖУ¬Õâ¶Î´úÂëÊÇÎÞЧµÄ£¬ÒòΪËüʹÓÃÁËÈý¸öÌØÊâ·ûºÅ£¬¼´Ð¡ÓÚ¡¢´óÓÚºÍË«ÒýºÅ¡£ÒªÐÞÕýÕâ¸öÎÊÌ⣬±ØÐë·Ö±ðÓÃÕâÈý¸ö×Ö·ûµÄXMLʵÌå<¡¢>ºÍ"Ìæ»»ËüÃÇ£º
<script type="text/javascript">
function compare(a,b)
{
if (a <b)
{alert("aСÓÚb");}
else if (a>b)
{alert("a´óÓÚb");}
else
{alert("aµÈÓÚb");}
}
</script>
Õâ¶Î´úÂë´æÔÚÁ½¸öÎÊÌâ¡£Ê×ÏÈ£¬¿ª·¢Õß²»Ï°¹ßÓÃXMLʵÌå±àд´úÂë¡£Õâʹ´úÂëºÜÄѶÁ¶®¡£Æä´Î£¬ÔÚJavaScriptÖУ¬ÕâÖÖ´úÂëʵ¼ÊÉϽ«ÊÓΪÓÐÓï·¨´í£¬ÒòΪ½âÊͳÌÐò²»ÖªµÀXMLʵÌåµÄÒâ˼¡£ÓÃCDATA¶Î¼´¿ÉÒÔÒÔ³£¹æÐÎʽ£¨¼´Ò׶ÁµÄÓï·¨£©±àдJavaScript´úÂë¡£Õýʽ¼ÓÈëCDATA¶ÎµÄ·½·¨ÈçÏ£º
<script type="text/javascript">
Ïà¹ØÎĵµ£º
Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......
C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´ ......
eclipseÖÐjavascriptÏÔʾΪÂÒÂëµÄ½â¾ö°ì·¨¡£
Òà¿ÉÒÀ´ÎÑ¡Ôñ²Ëµ¥"window">>"preferences">>"general">>"content types"
ÔÚÓұߵĴ°¿ÚÖдò¿ªÁбí,Ñ¡ÖÐ"JavaScript",ÔÚÏÂÃæµÄ"default encoding"ÓұߵÄÊäÈë¿òÖÐÊäÈëjavaScript±àÂ룬Ҫ¿´ÄúµÄÍøÒ³ÓõıàÂ룬Èç¹ûÊÇ“GBK”¾ÍÑ¡"GBK",ÊÇ"GB2312"¾ ......
¾¡¹Ü JavaScript ÀúÊ·ÉÏʹÓÃÈß³¤¶øÁîÈËÉúÑáµÄ´úÂë¿éÀ´±êµÄÌض¨ä¯ÀÀÆ÷µÄʱÆÚÒѾ½áÊøÁË£¬µ«ÊÇż¶ûʹÓÃһЩ¼òµ¥µÄ´úÂë¿éºÍ¶ÔÏó¼ì²âÀ´È·±£Ò»Ð©´úÂëÔÚÓû§»úÆ÷ÉÏÕý³£¹¤×÷ÒÀÈ»ÊDZØÒªµÄ¡£
ÕâƪÎÄÕÂÖУ¬ÎÒ»áÂÔÊöһϠInternet Explorer ºÍ Firefox ÔÚ JavaScript Óï·¨Éϲ»Í¬µÄ 7 ¸ö·½Ãæ¡£
1. CSS “float” ÊôÐÔ
Ȗ ......