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

JavaScript¾«´â¶ÁÊé±Ê¼Ç(3)

µÚ3Õ  ¶ÔÏó
JavaScriptµÄ¼òµ¥ÀàÐÍ°üÀ¨Êý×Ö¡¢×Ö·û´®¡¢²¼¶ûÖµ£¨trueºÍfalse£©¡¢nullÖµºÍundefinedÖµ¡£ÆäËûËùÓеÄÖµ¶¼ÊǶÔÏó¡£Êý×Ö¡¢×Ö·û´®ºÍ²¼¶ûÖµ“òËÆ”¶ÔÏó£¬ÒòΪËüÃÇÓµÓз½·¨£¬µ«ËüÃÇÊDz»¿É±äµÄ¡£JavaScriptÖеĶÔÏóÊǿɱäµÄ¼ü-Öµ¼¯ºÏ(keyed collections)¡£ÔÚJavaScriptÖУ¬Êý×éÊǶÔÏ󣬺¯ÊýÊǶÔÏó£¬ÕýÔò±í´ïʽÊǶÔÏ󣬵±È»£¬¶ÔÏó×ÔȻҲÊǶÔÏó¡£
¶ÔÏóÊÇÊôÐÔµÄÈÝÆ÷£¬ÆäÖÐÿ¸öÊôÐÔ¶¼ÓµÓÐÃû×ÖºÍÖµ¡£ÊôÐÔµÄÃû×Ö¿ÉÒÔÊÇ°üÀ¨¿Õ×Ö·û´®ÔÚÄÚµÄÈÎÒâ×Ö·û´®¡£ÊôÐÔÖµ¿ÉÒÔÊdzýundefinedÖµÖ®ÍâµÄÈκÎÖµ¡£
JavaScriptÖеĶÔÏóÊÇÎÞÀàÐÍ£¨Ä¬È»Ëµ»°£º»òÕß˵JavaScriptÖ»ÓÐÒ»ÖÖÀàÐÍ£¬¾ÍÊǶÔÏ󣩣¨class-free£©µÄ¡£Ëü¶ÔÐÂÊôÐÔµÄÃû×ÖºÍֵûÓÐÔ¼Êø¡£¶ÔÏóÊʺÏÓÃÓÚÊÕ¼¯ºÍ¹ÜÀíÊý¾Ý¡£¶ÔÏó¿ÉÒÔ°üº¬ÆäËû¶ÔÏó£¬ËùÒÔËüÃÇ¿ÉÒÔÈÝÒ׵رíʾ³ÉÊ÷ÐλòͼÐνṹ¡£
JavaScript°üÀ¨Ò»¸öÔ­ÐÍÁ´ÌØÐÔ£¬ÔÊÐí¶ÔÏó¼Ì³ÐÁíÒ»¶ÔÏóµÄÊôÐÔ¡£ÕýÈ·µØʹÓÃËüÄܼõÉÙ¶ÔÏó³õʼ»¯µÄʱ¼äºÍÄÚ´æÏûºÄ¡£
3.1   ¶ÔÏó¶¨Òå
¶ÔÏó¶¨ÒåÌṩÁËÒ»Öַdz£·½±ãµØ´´½¨Ð¶ÔÏóÖµµÄ±íʾ·¨¡£Ò»¸ö¶ÔÏó¶¨Òå¾ÍÊÇ°üΧÔÚÒ»¶Ô»¨À¨ºÅÖеÄÁã»ò¶à¸ö“Ãû:Öµ”¶Ô¡£¶ÔÏó¶¨Òå¿ÉÒÔ³öÏÖÔÚÈκÎÔÊÐí±í´ïʽ³öÏֵĵط½¡£
var empty_object={};
var stooge={
       “first-name”:”Jerome”,
       “last-name”:”Howard”
};
ÊôÐÔÃû¿ÉÒÔÊÇ»»ÊÖ¿Õ×Ö·û´®ÔÚÄÚµÄÈκÎ×Ö·û´®¡£ÔÚ¶ÔÏó¶¨ÒåÖУ¬Èç¹ûÊôÐÔÃûÊÇÒ»¸öºÏ·¨µÄJavaScript±êʶ·ûÇÒ²»ÊDZ£Áô×Ö£¬²¢²»Ç¿ÖÆÒªÇóÓÃÒýºÅÀ¨×¡ÊôÐÔÃû¡£ËùÒÔÓÃÒýºÅÀ¨×¡”first-name”ÊDZØÐëµÄ£¬µ«ÊÇ·ñÀ¨×¡first_nameÔòÊÇ¿ÉÑ¡µÄ¡£¶ººÅÓÃÀ´·Ö¸ô¶à¸ö“Ãû£ºÖµ”¶Ô¡£
ÊôÐÔµÄÖµ¿ÉÒÔ´Ó°üÀ¨ÁíÒ»¸ö¶ÔÏó¶¨ÒåÔÚÄÚµÄÈÎÒâ±í´ïʽÖлñµÃ¡£¶ÔÏóÊÇ¿ÉǶÌ׵ģº
var flight={
       airline:”Oceanic”,
       number:815,
       departure:{
              IATA:”SYD”,
              time:”2004-09-22 14:55”,
           


Ïà¹ØÎĵµ£º

JavaScriptÖÐʹÓÃÔ­ÐÍÀ´´´½¨¶ÔÏó

ÔÚ±àд¹¹Ô캯Êýʱ£¬¿ÉÒÔʹÓÃÔ­ÐͶÔÏó£¨Ëü±¾ÉíÊÇËùÓй¹Ô캯ÊýµÄÒ»¸öÊôÐÔ£©µÄÊôÐÔÀ´´´½¨¼Ì³ÐÊôÐԺ͹²Ïí·½·¨¡£Ô­ÐÍÊôÐԺͷ½·¨½«°´ÒýÓø´ÖƸøÀàÖеÄÿ¸ö¶ÔÏó£¬Òò´ËËüÃǶ¼¾ßÓÐÏàͬµÄÖµ¡£¿ÉÒÔÔÚÒ»¸ö¶ÔÏóÖиü¸ÄÔ­ÐÍÊôÐÔµÄÖµ£¬ÐµÄÖµ½«¸²¸ÇĬÈÏÖµ£¬µ«½öÔÚ¸ÃʵÀýÖÐÓÐЧ¡£ÊôÓÚÕâ¸öÀàµÄÆäËû¶ÔÏó²»Êܴ˸ü¸ÄµÄÓ°Ïì¡£ÏÂÃæ¸ø³öÁËʹÓÃ×Ô¶¨Òå ......

¸÷ÖÖÒ³ÃæˢдúÂë´óÈ«,asp/javascriptË¢ÐÂÒ³Ãæ´úÂë

Ò³Ãæ×Ô¶¯Ë¢Ð´úÂë´óÈ«£¬»ù±¾ÉÏËùÓÐÒªÇó×Ô¶¯Ë¢ÐÂÒ³ÃæµÄ´úÂ붼ÓУ¬´ó¼Ò¿ÉÒÔ×ÔÓÉ·¢»Ó×ö³öÍêÃÀµÄÒ³Ãæ¡£
1)
10±íʾ¼ä¸ô10ÃëË¢ÐÂÒ»´Î
2)
<script>
window.location.reload(true);
</script>
Èç¹ûÊÇÄãҪˢÐÂijһ¸öiframe¾Í°Ñwindow¸ø»»³ÉframeµÄÃû×Ö»òIDºÅ
3)
<script>
window.navigate("±¾Ò³Ãæurl"); ......

javascript±¸Íü

1.ÀûÓà document.location.href="/index.html" ¼ÒÔÚÒ»¸öÒ³Ãæ
2.ÀûÓÃthrow²¶»ñÒì³£
try
{
if(x>10)
  throw "Err1"
}
catch(er)
{
if(er=="Err1")
}
3.ʹÓ÷´Ð±¸Ü¶Ô´úÂë½øÐÐÕÛÐУº
document.write("Hello \
World!")
4.match() ·½·¨
ÈçºÎʹÓà match() À´²éÕÒ×Ö·û´®ÖÐÌض¨µÄ×Ö·û£¬²¢ÇÒÈç¹ûÕÒµ½µ ......

JavaScript CSS StyleÊôÐÔ¶ÔÕÕ±í

 from: http://sailinglee.javaeye.com/blog/423701
ΪÁ˴ﵽijÖÖÌØÊâµÄЧ¹ûÎÒÃÇÐëÒªÓÃJavascript¶¯Ì¬µÄÈ¥ÐÞ¸Äijһ¸ö±êÇ©µÄCssÊôÐÔ¡£±ÈÈ磺Êó±ê¾­¹ýÒ»¸öͼƬʱÎÒÃÇÈÃͼƬ¼ÓÒ»¸ö±ß¿ò£¬´úÂë¿ÉÄÜÊÇÕâÑù£º
 
Javascript´úÂë´úÂë
<script type="text/javascript">      &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ