javascriptµÄÀàÐÍת»»
Ò»¡¢ÀàÐÍת»»µÄ·½·¨ºÍÓ¦¸Ã×¢ÒâµÄÎÊÌ⣺
1£¬×ª»»Îª²¼¶ûÐÍ£º
£¨1£©ÓÃÁ½´Î·ÇÔËËã(!):
!!5 ==> true
£¨2£©Óò¼¶ûÐ͵Ĺ¹Ô캯Êý£º
new Boolean(5) == > true
ֵת»»Îª²¼¶ûÀàÐÍΪfalse£º
0£¬+0£¬-0£¬NaN£¬""(¿Õ×Ö·û´®),undefined,null
³ýÉÏÃæµÄÖµÆäËûÖµÔÚת»»ÒÔºóΪtrue£¬ÐèÒªÌرðÌáµ½µÄÊÇ:
"0",new Object(),function(){}
2,ת»»Îª×Ö·û´®ÀàÐÍ£º
£¨1£©¼ÓÉÏ¿Õ×Ö·û´®""£º
123 +¡¡"" = "123"
£¨2£©ÓÃ×Ö·û´®¹¹Ô캯Êý£º
new String(123) = "123".
ÐèÒªÌرð×¢ÒâµÄת»¯£º
+0 ==> "0"
-0 ==> "0"
-Infinity ==>"-Infinity"
+Infinity ==>"+Infinity"
NaN ==> "NaN"
undefined ==> "undefined"
null ==> "null"
new Object() ==> "[object Object]"
function(){} ==> "function(){}"
3,ת»»ÎªÊýÖµÐÍ£º
£¨1£© È¡Õý£¨+£©£¬ ¼õÁã £¨-0£©£¬ ³ËÒ»£¬£¨*1£©£¬³ýÒÔÒ»£¨/1),È¡¸º£¨-£¬Õâ¸öµÃµ½Ïà·´µÄÖµ£©¡£
+"123" = 123
+true = 1
£¨2£©Óù¹Ô캯ÊýNumber();
new Number("123") = 123
¼¸¸öÐèÒªÌرð×¢ÒâµÄת»¯£º
""£¨¿Õ×Ö·û´®£© ==> 0
"010" ==> 10
"0x10"(16½øÖÆ) ==> 16
"-010" ==> -10
"-0x10" ==> NaN
undefined ==> NaN
null ==> 0
true ==> 1
false ==> 0
new Object() ==> NaN
new function(){} ==> NaN
¶þ¡¢ÒþʽÀàÐÍת»»£º
(1)¶þÔª¼Ó·¨ÔËË㣨+£©£ºÈç¹ûÁ½¸ö²Ù×÷ÊýÖÐÓÐÒ»¸öÊÇStringÀàÐÍ£¬½«°ÑÁ½¸ö²Ù×÷Êýת»»ÎªStringÀàÐÍÔÙÏà¼Ó¡£
Èç¹ûÁ½¸ö²Ù×÷ÊýÖÐûÓÐ×Ö·û´®ÀàÐÍ£¬ÄÇô½«°ÑÁ½¸ö²Ù×÷Êýת»»ÎªÊýÖµÀàÐÍÔÙ×öÔËËã¡£
¾ÙÀý£º
"123"+123 = "123123";
123+123 = 246
true + true = 2
true + undefined = NaN £¨ÒòΪundefinedת»»ÎªÊýֵΪNaN,ËùÓнá¹ûΪNaN)
true + null = 1 (nullת»»ÎªÊý×ÖÊÇ0)
"123" + null = "123null" (°üº¬×Ö·û´®½«×ª»¯Îª×Ö·û´®Ïà¼Ó)
"123" + undefined = "123undefined" £¨undefinedͬÑùÊÊÓã©
1 + 2 + "123" = "3123" (1+2ÊÇÊ×ÏÈ°´ÕÕÊýÖµÐͼÆËãµÄ)
(2)¶þÔª¼õ³Ë³ýÔËË㣨-*/):ÒòΪֻÓÐÊýÖµÀàÐͲÅÓÐ - * / ÔËË㣬ËùÒÔ»áÏȽ«Á½¸ö²Ù×÷Êýת»»ÎªÊýÖµÐÍÔÙ×öÔËËã¡£
"123"-123 = 0
(3)һԪȡÕý£¨+£©£¬È¡¸ºÔËËã·û(-):È¡Õý»òÕßÈ¡¸º¶¼ÊÇÕë¶ÔÊýÖµÐ͵ÄÔËË㣬ËùÒԻὫ²Ù×÷Êýת»»ÎªÊýÖµÐÍÔÙ×öÔËËã¡£
+"123" = 123
-"123" = -123
+"123e" = NaN
+"123f" = NaN
+"123e-2" = 1.23
(4)Ò»Ôª·Ç(!)ÔËËã·û:·ÇÔËËã·ûÐèÒª½«²Ù×÷Êýת»¯Îª²¼¶ûÀàÐÍ¡£
Ïà¹ØÎĵµ£º
ÍøÒ³ÖÆ×÷Javascript¾µäС¼¼ÇÉ×ܽá
http://www.webjx.com ¸üÐÂÈÕÆÚ£º2007-10-12 01:25 ³ö´¦£ºÍøÒ³½ÌѧÍø ×÷ÕߣºÕ¾³¤ÕûÀí
ÿһÏÊÇJSÖеÄС¼¼ÇÉ£¬µ«Ê®·ÖµÄʵÓã¡
1.document.write(”"); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ ......
ÒòΪJSON ÊÇ javascript µÄÒ»¸ö×Ó¼¯£¬ËùÒÔ£¬ÔÚjavascript ÖÐʹÓÃJSONÊǷdz£¼òµ¥µÄ¡£
js ´úÂë
var myJSONObject = {"bindings": [
{"ircEvent": "PRIVMSG", "method":&n ......
JavascriptË¢ÐÂÒ³ÃæµÄ¼¸ÖÖ·½·¨£º
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7& ......
AA.HTM
-------------------------------------
<!--
showModalDialogº¯ÊýµÄʹÓà (ת)
±¾·¶Àý¿ÉÒÔʵÏÖµ¯³öÒ»¸öģ̬´°¿Ú£¬²¢ÑÝʾÁËÁ½ÖÖ½ÓÊպʹ«µÝ²ÎÊýµÄ·½·¨£¬Í¬Ê±¿ÉÒÔ½ÓÊÜģ̬´°¿Ú·µ»ØµÄ¶à¸ö±äÁ¿
-->
<html> &nbs ......
Óï·¨
oNewWindow = window.open( [sURL] [, sName] [, sFeatures] )
sURL ¿ÉÑ¡. URL ×Ö·û´® . Èç¹ûURLΪ¿Õ, ½«ÒÔabout:blank´ò¿ª.
sName ¿ÉÑ¡. ×Ö·û´® ÃèÊö´ò¿ª´°¿ÚµÄÃû×Ö(name). ¿ÉÒÔ×öΪform ºÍ a ±êÇ©µÄTARGETÊôÐÔÖµ .
sFeatures ¿ÉÑ¡. ×Ö·û´® ¸ñʽÈç"fullscreen=yes,toolbar=yes".channelmode = { yes | no | ......