JavaScriptѧϰ±Ê¼Ç£¨¶þ£©
1.ECMAScriptµÄ»ù´¡¸ÅÄîÈçÏ£º
Çø·Ö´óСд
±äÁ¿Ê±ÈõÀàÐ͵Ä
ÿÐнáβµÄ·ÖºÅ¿ÉÓпÉÎÞ
×¢ÊÍÓëJava¡¢CºÍPHPÓïÑÔÏàͬ
»¨À¨ºÅ±íÃ÷´úÂë¿é
2.ÓëPython²»Í¬£¬ECMAScriptÖеıäÁ¿²»Ò»¶¨Òª³õʼ»¯£¬È磺
var test; //ÕýÈ·
3.±äÁ¿ÃûÐèÒª×ñÊØÁ½Ìõ¼òµ¥µÄ¹æÔò£º
µÚÒ»¸ö×Ö·û±ØÐëÊÇ×Öĸ¡¢Ï»®Ïߣ¨_£©»òÃÀÔª·ûºÅ£¨$£©
ÓàϵÄ×Ö·û¿ÉÒÔÊÇÏ»®Ïß¡¢ÃÀÔª·ûºÅ»òÈκÎ×Öĸ»òÊý×Ö
4.ÔÚECMAScriptÖУ¬±äÁ¿¿ÉÒÔ´æ·ÅÁ½ÖÖÀàÐ͵ÄÖµ£¬¼´ÔʼֵºÍÒýÓÃÖµ£º
ÔʼֵÊÇ´æ´¢ÔÚÕ»£¨stack£©Öеļòµ¥Êý¾Ý¶Î
ÒýÓÃÖµÊÇ´æ´¢Ôڶѣ¨heap£©ÖеĶÔÏó£¬Ò²¾ÍÊÇ˵£¬´æ´¢ÔÚ±äÁ¿´¦µÄÖµÊÇÒ»¸öÖ¸Õë
5.ECMAScriptÓÐ5ÖÖÔʼÀàÐÍ£¬¼´Undefined¡¢Null¡¢Boolean¡¢NumberºÍString¡£ECMAScriptÌṩÁËtypeofÔËËã·ûÀ´ÅжÏÒ»¸ö±äÁ¿»òÖµµÄÀàÐÍ£¬È磺
var sTemp="test string";
alert(typeof sTemp); //µ¯³ö“string”
Èç¹û±äÁ¿ÊÇÒýÓÃÀàÐÍ£¬Ôòtypeof·µ»ØֵΪ“object”¡£
6.UndefinedÀàÐÍÖ»ÓÐÒ»¸öÖµ£¬¼´undefined¡£
µ±ÉùÃ÷µÄ±äÁ¿Î´³õʼ»¯Ê±£¬¸Ã±äÁ¿µÄĬÈÏÖµÊÇundefined
µ±º¯ÊýÎÞÃ÷È··µ»Øֵʱ£¬·µ»ØµÄÖµÒ²ÊÇundefined
7.NullÀàÐÍÒ²Ö»ÓÐÒ»¸öÖµ£¬¼´null¡£ECMAScript°ÑundefinedºÍnull¶¨ÒåΪÏàµÈµÄ£¬¼´£º
alert(null==undefined); //µ¯³ö“true”
null±íʾÉÐδ´æÔڵĶÔÏó¡£Èç¹ûº¯Êý»ò·½·¨Òª·µ»ØµÄÊǶÔÏó£¬ÄÇôÕÒ²»µ½¸Ã¶ÔÏóʱ£¬·µ»ØµÄͨ³£ÊÇnull¡£
8.NumberÀàÐͼȿÉÒÔ±íʾ32λµÄÕûÊý£¬»¹¿ÉÒÔ±íʾ64λµÄ¸¡µãÊý¡£
9.¾¡¹ÜËùÓÐÕûÊý¶¼¿É±íʾΪ°Ë½øÖÆ»òÊ®Áù½øÖƵÄ×ÖÃæÁ¿£¬µ«ËùÓÐÊý×ÖÔËËã·µ»ØµÄ¶¼ÊÇÊ®½øÖƽá¹û¡£
10.NumberÀàÐÍÖеļ¸¸öÌØÊâÖµ£º
Infinity±íʾÕýÎÞÇî´ó
-Infinity±íʾ¸ºÎÞÇî´ó
NaN±íʾ·ÇÊý£¨Not a Number£©£¬Ò»°ã³öÏÖÔÚÀàÐÍת»»Ê§°Üʱ¡£ÌرðµÄÊÇ£¬NaNÓëËü×ÔÉí²»ÏàµÈ
11.ת»»³É×Ö·û´®
ECMAScriptµÄBoolean¡¢NumberºÍStringÔʼÀàÐÍÊÇα¶ÔÏ󣬼´ËüÃÇʵ¼ÊÉϾßÓÐÊôÐԺͷ½·¨£¬Æ©Èç»ñµÃ×Ö·û´®µÄ³¤¶È£º
var sColor="blue";
alert(sColor.length); //µ¯³ö“4”
ÒÔÉÏÈýÖÖÖ÷ÒªµÄÔʼÀàÐͶ¼ÓÐtoString()·½·¨£¬¿ÉÒÔ°ÑËüÃǵÄֵת»
Ïà¹ØÎĵµ£º
nodeName
nodeName ÊôÐÔº¬ÓÐij¸ö½ÚµãµÄÃû³Æ¡£
ÔªËؽڵãµÄ nodeName ÊDZêÇ©Ãû³Æ
ÊôÐÔ½ÚµãµÄ nodeName ÊÇÊôÐÔÃû³Æ
Îı¾½ÚµãµÄ nodeName ÓÀÔ¶ÊÇ #text
Îĵµ½ÚµãµÄ nodeName ÓÀÔ¶ÊÇ #document
×¢ÊÍ£ºnodeName Ëù°üº¬µÄ XML ÔªËصıêÇ©Ãû³ÆÓÀÔ¶ÊÇ´óдµÄ
nodeValue
¶ÔÓÚÎı¾½Úµã£¬nodeValue ÊôÐÔ°üº¬Îı¾¡£
¶ÔÓÚÊô ......
½ûֹѡÔñ
unselectable="on"(off): IE/Opera
style="-moz-user-select:none": FireFox(JS:element.style.MozUserSelect = "none";)
style="-khtml-user-select:none": Safari(JS:element.style.KhtmlUserSelect)
ons ......
Ò»£¬Ç°ÑÔ
CookiesÏë±ØËùÓÐÈ˶¼Á˽⣬ µ«ÊÇδ±ØËùÓÐÈ˶¼¾«Í¨¡£±¾ÎĽ²½âÁËCookiesµÄ¸÷·½Ãæ֪ʶ£¬ ²¢ÇÒÌá³öÀ´ÁË×î¼Ñʵ¼ù¡£ÕâÊDZÊÕßÔÚÈÕ³£¹¤×÷ÖеĻýÀۺͳÁµí¡£
¶þ£¬»ù´¡ÖªÊ¶
1.ʲôÊÇCookies
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæ×ÅÓû§ÇëÇóºÍÒ³ÃæÔÚ Web ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Cookie °üº¬Ã¿´ÎÓû§·ÃÎÊÕ¾µãʱ Web Ó¦ÓóÌÐò¶¼¿ ......
W3SchoolÊÇÒ»¸öºÜºÃµÄ³õѧÕßѧϰÍøÕ¾¡£ÏÂÃæµÄÊÇÀïÃæµÄÄÚÈÝ£¬Ö÷ÒªÊÇjavascript¶ÔÏóµÄAPI˵Ã÷ÓëʹÓã¬Ï£ÍûÔÚ²»¶®µÄʱºò¿ÉÒԺܷ½±ãµØ²é¿´µ½ËùÐèÒªµÄÒÉÎÊ¡£
JavaScript String ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_string.asp
JavaScript Date ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_dat ......
<script language="javascript" type="text/javascript">
function arrayTest() {
//ʹÓÃnew Array()
var array1 = ......