javascript typeofµÄÓ÷¨
javascript typeofµÄÓ÷¨
¾³£»áÔÚjsÀïÓõ½Êý×é,±ÈÈç ¶à¸öÃû×ÖÏàͬµÄinput, ÈôÊǶ¯Ì¬Éú³ÉµÄ, Ìύʱ¾ÍÐèÒªÅжÏÆäÊÇ·ñÊÇÊý×é.
if(document.mylist.length != "undefined" ) {} Õâ¸öÓ÷¨ÓÐÎó.
ÕýÈ·µÄÊÇ if( typeof(document.mylist.length) != "undefined" ) {}
»ò if( !isNaN(document.mylist.length) ) {}
typeofµÄÔËËãÊý䶨Òå,·µ»ØµÄ¾ÍÊÇ "undefined".
ÔËËãÊýΪÊý×Ö typeof(x) = "number"
×Ö·û´® typeof(x) = "string"
²¼¶ûÖµ typeof(x) = "boolean"
¶ÔÏó,Êý×éºÍnull typeof(x) = "object"
º¯Êý typeof(x) = "function"
typeof ÔËËã·û·µ»ØÒ»¸öÓÃÀ´±íʾ±í´ïʽµÄÊý¾ÝÀàÐ͵Ä×Ö·û´®¡£
¿ÉÄܵÄ×Ö·û´®ÓУº"number"¡¢"string"¡¢"boolean"¡¢"object"¡¢"function" ºÍ "undefined"¡£
È磺
alert(typeof (123));//typeof(123)·µ»Ø"number"
alert(typeof ("123"));//typeof("123")·µ»Ø"string"
typeof ÔËËã·û
·µ»ØÒ»¸öÓÃÀ´±íʾ±í´ïʽµÄÊý¾ÝÀàÐ͵Ä×Ö·û´®¡£
typeof[()expression[]] ;
expression ²ÎÊýÊÇÐèÒª²éÕÒÀàÐÍÐÅÏ¢µÄÈÎÒâ±í´ïʽ¡£
˵Ã÷
typeof ÔËËã·û°ÑÀàÐÍÐÅÏ¢µ±×÷×Ö·û´®·µ»Ø¡£typeof ·µ»ØÖµÓÐÁùÖÖ¿ÉÄÜ£º "number," "string," "boolean," "object," "function," ºÍ "undefined."
typeof Óï·¨ÖеÄÔ²À¨ºÅÊÇ¿ÉÑ¡Ïî¡£
Ïà¹ØÎĵµ£º
eclipseÖÐjavascriptÏÔʾΪÂÒÂëµÄ½â¾ö°ì·¨¡£
Òà¿ÉÒÀ´ÎÑ¡Ôñ²Ëµ¥"window">>"preferences">>"general">>"content types"
ÔÚÓұߵĴ°¿ÚÖдò¿ªÁбí,Ñ¡ÖÐ"JavaScript",ÔÚÏÂÃæµÄ"default encoding"ÓұߵÄÊäÈë¿òÖÐÊäÈëjavaScript±àÂ룬Ҫ¿´ÄúµÄÍøÒ³ÓõıàÂ룬Èç¹ûÊÇ“GBK”¾ÍÑ¡"GBK",ÊÇ"GB2312"¾ ......
×î½ü×öÒ»¸ö¹«Ë¾µÄÒµÎñϵͳ£¬¹«Ë¾ÒªÇóÄܾ¡¿ÉÄܵÄÓëc/s½üËÆ£¬Ò²¾ÍÊÇÈçc/sÒ»Ñù£¬µã»÷Îı¾¿ò¿ÉÒÔµ¯³ö´ËÏîÄ¿µÄÏà¹ØÄÚÈÝ£¬½øÐÐÑ¡ÔñÊäÈë¡£
ÎÒʹÓÃÁ˵¯³ö´°¿Ú£¬È»ºóÔÚ×Ó´°¿ÚË«»÷Ñ¡ÖÐÏîÄ¿£¬°ÑÑ¡ÖеÄÖµ·µ»Ø¸ø¸¸´°Ìå¡£
ÔÚϵͳ×öÍêÁËÖ®ºó£¬ÔÚ¿Í»§Ê¹ÓõĹý³Ì£¬ÓÉÓÚ¿Í»§Ê¹ÓõÄÊÇ512m ......
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄܲÙ×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´®¡£ÓÃÀ´Ö¸¶¨¶Ô»°¿òÒªÏ ......
·Çģ̬ˢи¸Ò³Ã棺window.opener.location.reload();
ģ̬ˢи¸Ò³Ã棺window.dialogArguments.location.reload();
ÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÏÂÃæÒÔÈý¸öÒ³Ãæ·Ö±ðÃüÃûΪframe.html¡¢top.html¡¢bottom.htmlΪÀýÀ´¾ßÌå˵Ã÷ÈçºÎ×ö¡£
frame.html ÓÉÉÏ(top.html)ÏÂ(bo ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´°Ìå»î¶¯ÔªËØ
d ......