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">
Ïà¹ØÎĵµ£º
2007-01-20 01:01
ieµÄjavascriptʧЧÁË£¬²»ÊÇÉèÖõÄÎÊÌâ
ÕÛÌÚÁËÒ»ÍíÉÏÖÕÓÚÔÚˮľÉÏÕÒµ½´ð°¸ÁË,¾¹ýÊÔÑé³É¹¦ÁË¡£¸ÐлÕâλhaning¡£Ò²Ï£ÍûתÔØÖ®ºó£¬ÕâƪÎÄÕÂÄÜ°ïÖú¸ü¶àµÄÈË¡£
================================================
·¢ÐÅÈË: haning (°Øº®Óî), ÐÅÇø: Virus
±ê Ìâ: KAV6.0ʹjavascriptÓï¾äʧЧÐÞ¸´·½·¨ ......
1.delete ÔËËã·û
¶ÔÏóɾ³ýÒ»¸öÊôÐÔ£¬»òÊý×éÖÐɾ³ýÒ»¸öÔªËØ¡£½«ÎÞÓõÄÄÚÈÝɾ³ýÒÔ½ÚÊ¡¿Õ¼ä¡£
delete expression
example:
var person = new Object();
person.sex = "male";
alert(person.sex);
delete person.sex;
alert(person.sex);
2. ‘,' ÔËËã·û
var a = 2;
......
1
¡¢Àí½âdocument.all
[]
¡¡¡¡´ÓIE4¿ªÊ¼IEµÄobject
model²ÅÔö¼ÓÁËdocument.all
[],À´¿´¿´document.all
[]µÄDescription:
Array
of all HTML tags in the document.Collection of all elements contained by the
object.
¡¡¡¡Ò²¾ÍÊÇ˵document.all
[]ÊÇÎĵµÖÐËùÓбêÇ©×é³ÉµÄÒ»¸öÊý×é±äÁ¿£¬°üÀ¨ÁËÎĵµ¶ÔÏóÖÐËùÓ ......
! È¥³ý×Ö·û´®Á½¶Ë¿Õ¸ñµÄ´¦Àí
¡¡¡¡Èç¹û²ÉÓô«Í³µÄ·½Ê½,¾ÍÒª¿ÉÄܾÍÒª²ÉÓÃÏÂÃæµÄ·½Ê½ÁË
¡¡¡¡//Çå³ý×ó±ß¿Õ¸ñ
¡¡¡¡function js_ltrim(deststr)
¡¡¡¡{
¡¡¡¡if(deststr==null)return "";
¡¡¡¡var pos=0;
¡¡¡¡var retStr=new String(deststr);
¡¡¡¡if (retStr.lenght==0) return retStr;
¡¡¡¡while (retStr.substring(pos, ......
±¾ÎÄת×Ô£ºhttp://www.felixwoo.com/archives/247
×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
Ò»¡¢Ê²Ã´ÊDZհü£¿
“¹Ù·½”µÄ½âÊÍÊÇ£º±Õ°üÊ ......