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

javascript ѧϰ±Ê¼Ç£¨2£©

1. BooleanÖµ¡¢Êý×Ö¡¢×Ö·û´®µÄԭʼֵÊÇα¶ÔÏó£¬ÕâÒâζ×ÅËûÃǾßÓÐÊôÐԺͷ½·¨¡£
var test = "hello";
alert(test.length); //outputs "5" 
2. javascript Ëù¶¨ÒåµÄËùÓжÔÏó¶¼ÓÐ toString() ·½·¨£¬²»¹ÜÊÇα¶ÔÏó»¹ÊÇÕæµÄ¶ÔÏó£¬Boolean µÄ toString() ·½·¨Ö»·µ»Ø “true” »òÕß“false”¡£
var test = false;
alert(test.toString()); //outputs "false" 
3. parseInt() ºÍ parseFloat()
alert(parseInt("1234test")); //outputs "1234"
alert(parseInt("0xA")); //outputs "10"
alert(parseInt("22.1")); //outputs "22"
alert(parseInt("test")); //outputs "NaN" 
4. String() ºÍ toString() ΨһµÄÇø±ðÔÚÓÚ¶Ô null »òÕß undefined ÖµµÄÇ¿ÖÆת»»ÉÏ¡£
var test = String(null) //"null"
var test1 = null;
var test2 = test1.toString(); //»á²úÉú´íÎó 
5. Object “Àà”¡£
¾ßÓÐÒÔÏÂÊôÐÔ
Constructor---¶Ô´´½¨¶ÔÏóµÄº¯ÊýµÄÒýÓã¨Ö¸Õ룩¡£¶ÔÓÚ Object Àà¸ÃÖ¸ÕëÖ¸ÏòԭʼµÄ Object() º¯Êý¡£
Prototype---¶Ô¸Ã¶ÔÏóµÄ¶ÔÏóÔ­Ð͵ÄÒýÓá£
¾ßÓÐÒÔÏ·½·¨
HasOwnProperty(property)---Åж϶ÔÏóÊÇ·ñÓÐÌض¨µÄÊôÐÔ¡£
IsPrototypeOf---ÅжϸöÔÏóÊÇ·ñΪÁíÒ»¸ö¶ÔÏóµÄÔ­ÐÍ¡£
PropertyIsEnumerable---Åжϸø¶¨µÄÊôÐÔÊÇ·ñ¿ÉÒÔÓÃfor...inÓï¾ä½øÐÐö¾Ù¡£
toString()---·µ»Ø¶ÔÏóµÄԭʼ×Ö·û´®±íʾ¡£
ValueOf()---·µ»Ø×îÊʺϸöÔÏóµÄԭʼֵ¡£


Ïà¹ØÎĵµ£º

cssºÍjavascriptÔÚIEºÍFirefoxÖжþÊ®Èý¸ö²»Í¬µã

Ò»¡¢document.formName.item(“itemName”) ÎÊÌâ
ÎÊÌâ˵Ã÷£ºIEÏ£¬¿ÉÒÔʹÓà document.formName.item(“itemName”) »ò document.formName.elements ["elementName"]£»FirefoxÏ£¬Ö»ÄÜʹÓÃdocument.formName.elements["elementName"]¡£
½â¾ö·½·¨£ºÍ³Ò»Ê¹ÓÃdocument.formName.elements["elementName" ......

Ïêϸ½â¶ÁJavaScriptµÄthis¹Ø¼ü×Ö


ÓÃÁ˺ܾÃJavaScript£¬¶Ô¡¾this¡¿µÄÈÏʶֻ¾ÖÏÞÓÚÒÔÍùµÄƾ¾­Ñé¶øÒÑ£¬²»¹ý½ñÌì·¢ÏÖÁ˺ö«Î÷“http://www.quirksmode.org/js/associative.html”£¬ÏêϸÃèÊöÁËÈçºÎʹÓá¾this¡¿¹Ø¼ü×Ö£¬ÔÚÕâÀïÎҾͼò¶ÌµÄ˵һÏÂÖص㣬Èç¹ûÓÐÒÉÎÊ¿ÉÒÔÖ±½Ó²Î¿¼Ô­ÎÄ¡£
ÔÚѧϰ¹ýÓÐthisµÄ±à³ÌÓïÑÔÖУ¬thisÒ»°ã¶¼ÊÇÖ¸Ïòµ±Ç°ÊµÀý¶ÔÏóµÄ£¬¶ÔÓ ......

Ò»¸öCSS+JavaScript±àдµÄÅÜÂíµÆ³ÌÐò

ת×Ô£º
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ͼƬÅÜÂíµÆ</title>
</head>
<body>
<div style="overflow:hidden; width:350px" id='div'>
<!-- ÕâÀïÊǵÚÒ»¸ö¹Ø¼üµã£¬o ......

ѧϰ¡¶JavaScript¸ß¼¶³ÌÐòÉè¼Æ¡·Ñ§Ï°±Ê¼Ç£¨Èý£©

µÚÈýÕ   ¶ÔÏó»ù´¡
      ÔÚjavaScriptÖУ¬¶ÔÏóÊÇÎÞÌض¨Ë³ÐòµÄÖµµÄÊý×é¡£
Ò»¡¢¶ÔÏóµÄÀàÐÍ
    ·ÖΪ±¾µØ¶ÔÏó¡¢ÄÚÖöÔÏóºÍËÞÖ÷¶ÔÏóÈýÖÖ£¬ÆäÖÐÄÚÖöÔÏóÒ²ÊôÓÚ±¾µØ¶ÔÏó¡£
¶þ¡¢±¾µØ¶ÔÏó£º
    1¡¢ArrayÀ࣬Êý×éÀà¡£
      ......

JavaScriptÖÐtoGMTStringº¯Êý

JavaScriptÖÐtoGMTStringº¯Êý·½·¨ÊÇ·µ»ØÒ»¸öÈÕÆÚ£¬¸ÃÈÕÆÚÓøñÁÖÍþÖαê׼ʱ¼ä (GMT) ±íʾ²¢Òѱ»×ª»»Îª×Ö·û´®¡£Ê¹Ó÷½·¨£º
dateObj .toGMTString()
JavaScriptÖÐtoGMTStringº¯Êý·½·¨ÒѾ­¹ýʱ£¬Ö®ËùÒÔÈÔÈ»ÌṩÕâ¸ö·½·¨£¬Ö»ÊÇΪÁËÌṩÏòºóµÄ¼æÈÝÐÔ¡£ÍƼö¸ÄÓà toUTCString ·½·¨¡£
toGMTString ·½·¨·µ»ØÒ»¸ö String ¶ÔÏó£¬´Ë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ