Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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ʵÌå&lt;¡¢&gt;ºÍ&quot;Ìæ»»ËüÃÇ£º
<script type="text/javascript">
function compare(a,b)
{
if (a &lt;b)
   {alert(&quot;aСÓÚb&quot;);}  
else if (a&gt;b)
   {alert(&quot;a´óÓÚb&quot;);}
else
   {alert(&quot;aµÈÓÚb&quot;);}
}
</script>
Õâ¶Î´úÂë´æÔÚÁ½¸öÎÊÌâ¡£Ê×ÏÈ£¬¿ª·¢Õß²»Ï°¹ßÓÃXMLʵÌå±àд´úÂë¡£Õâʹ´úÂëºÜÄѶÁ¶®¡£Æä´Î£¬ÔÚJavaScriptÖУ¬ÕâÖÖ´úÂëʵ¼ÊÉϽ«ÊÓΪÓÐÓï·¨´í£¬ÒòΪ½âÊͳÌÐò²»ÖªµÀXMLʵÌåµÄÒâ˼¡£ÓÃCDATA¶Î¼´¿ÉÒÔÒÔ³£¹æÐÎʽ£¨¼´Ò׶ÁµÄÓï·¨£©±àдJavaScript´úÂë¡£Õýʽ¼ÓÈëCDATA¶ÎµÄ·½·¨ÈçÏ£º
<script type="text/javascript">


Ïà¹ØÎĵµ£º

Javascript °´¼üʼþ


AS("#...").keypress(function(event) {
        if (navigator.userAgent.toLowerCase().indexOf("mozilla") >= 0) {
         var $key = event.charCode ;
        } else {
         var $key = event. ......

Ôö¼Ó javascript µÄ trim º¯Êý


È¥³ý×Ö·û´®×óÓÒÁ½¶ËµÄ¿Õ¸ñ£¬ÔÚvbscriptÀïÃæ¿ÉÒÔÇáËɵØʹÓàtrim¡¢ltrim »ò rtrim£¬µ«ÔÚjsÖÐȴûÓÐÕâ3¸öÄÚÖ÷½·¨£¬ÐèÒªÊÖ¹¤±àд¡£ÏÂÃæµÄʵÏÖ·½·¨ÊÇÓõ½ÁËÕýÔò±í´ïʽ£¬Ð§Âʲ»´í£¬²¢°ÑÕâÈý¸ö·½·¨¼ÓÈëString¶ÔÏóµÄÄÚÖ÷½·¨ÖÐÈ¥¡£
<input type="text" name="mytxt" value="   12345678 &nbs ......

javascript:void(0)

½ñÌì¿´µ½¡¶AJAX¿ª·¢¼òÂÔ¡·ÖÐËùÓеÄ<A href>¶¼Óõ½ÁËjavascript:void(0)
½ñÌì¿´ÁËÒ»ÏÂÔ­À´Õâ¸ö±í´ïʽµÄ×÷ÓþÍÊÇÈõ±Ç°Õâ¸ö³¬Á´½Ó³ÉΪһ¸öËÀÁ´½Ó£¬¾ÍÊÇʲô¶¼²»×÷¡£
ÒÔÏÂÕª×Ô£º
http://blog.csdn.net/mouyong/archive/2007/01/24/1491761.aspx
±ðÈËЩµÄJavaScript½Å±¾¿ÉÒÔ¿´µ½ÕâÑùµÄ´úÂ룺
<a href="javascript ......

JavaScriptµÄÓ¦ÓÃ×ܽá(1)

      ÒÔÇ°ÒòΪ½Ó´¥µÄÏîÄ¿£¬Óõ½javascriptµÄµØ·½£¬±¾È˶ÔjavascriptÕâ¸ö¶«Î÷ÈÏʶ²»¹»£¬ÉõÖÁÒÔΪÊÇǰ̨³ÌÐòÔ±µÄ¹¤×÷¡£×î½ü×öµÄÏîÄ¿ÀïÃæÓõ½Á˺ܶàÕâÖֽű¾ÓïÑÔ£¬²Å·¢ÏÖÕâ¸öС¶«¶«ÊµÔÚÊǺܿɰ®£¬ËäÈ»ºÜÌÔÆø£¨²»ÊǺÜÃæÏò¶ÔÏñ£¬²»ÊǺܺõ÷ÊÔ£©£¬µ«ÊÇÖ»ÒªÊÇ×öweb¿ª·¢µÄ£¬¶¼ÄÑÃâÒª½Ó´¥µ½Ëû£¬°ÑÕ⸠......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ