JavaScriptʼþ´óÈ«
JavaScriptʼþ´óÈ«
click() ¶ÔÏó.click() ʹ¶ÔÏó±»µã»÷¡£
closed ¶ÔÏó.closed ¶ÔÏó´°¿ÚÊÇ·ñÒѹرÕtrue/false
clearTimeout(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetTimeout¶ÔÏó
clearInterval(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetInterval¶ÔÏó
confirm("ÌáʾÐÅÏ¢") µ¯³öÈ·ÈÏ¿ò£¬È·¶¨·µ»ØtrueÈ¡Ïû·µ»Øfalse
cursor:Ñùʽ ¸ü¸ÄÊó±êÑùʽ hand crosshair text wait help default auto
e/s/w/n-resize
event.clientX ·µ»Ø×îºóÒ»´Îµã»÷Êó±êX×ø±êÖµ£»
event.clientY ·µ»Ø×îºóÒ»´Îµã»÷Êó±êY×ø±êÖµ£»
event.offsetX ·µ»Øµ±Ç°Êó±êÐüÍ£X×ø±êÖµ
event.offsetY ·µ»Øµ±Ç°Êó±êÐüÍ£Y×ø±êÖµ
document.write(document.lastModified) ÍøÒ³×îºóÒ»´Î¸üÐÂʱ¼ä
document.ondblclick=x µ±Ë«»÷Êó±ê²úÉúʼþ
document.onmousedown=x µ¥»÷Êó±ê¼ü²úÉúʼþ
document.body.scrollTop; ·µ»ØºÍÉèÖõ±Ç°ÊúÏò¹ö¶¯ÌõµÄ×ø±êÖµ£¬ÐëÓ뺯ÊýÅäºÏ
,
document.body.scrollLeft; ·µ»ØºÍÉèÖõ±Ç°ºáÏò¹ö¶¯ÎñµÄ×ø±êÖµ£¬ÐëÓ뺯ÊýÅä
ºÏ£¬
document.title document.title="message"; µ±Ç°´°¿ÚµÄ±êÌâÀ¸ÎÄ×Ö
document.bgcolor document.bgcolor="ÑÕÉ«Öµ"; ¸Ä±ä´°¿Ú±³¾°ÑÕÉ«
document.Fgcolor document.Fgcolor="ÑÕÉ«Öµ"; ¸Ä±äÕýÎÄÑÕÉ«
document.linkcolor document.linkcolor="ÑÕÉ«Öµ"; ¸Ä±ä³¬Áª½ÓÑÕÉ«
document.alinkcolor document.alinkcolor="ÑÕÉ«Öµ"; ¸Ä±äÕýµã»÷Áª½ÓµÄÑÕÉ«
document.VlinkColor document.VlinkColor="ÑÕÉ«Öµ"; ¸Ä±äÒÑ·ÃÎÊÁª½ÓµÄÑÕÉ«
document.forms.length ·µ»Øµ±Ç°Ò³form±íµ¥Êý
document.anchors.length ·µ»Øµ±Ç°Ò³ÃªµÄÊýÁ¿
document.links.length ·µ»Øµ±Ç°Ò³Áª½ÓµÄÊýÁ¿
document.onmousedown=x µ¥»÷Êó±ê´¥·¢Ê¼þ
document.ondblclick=x Ë«»÷Êó±ê´¥·¢Ê¼þ
defaultStatus window.status=defaultStatus; ½«×´Ì¬À¸ÉèÖÃĬÈÏÏÔʾ
function function xx(){...} ¶¨Ò庯Êý
isNumeric ÅжÏÊÇ·ñÊÇÊý×Ö
innerHTML xx=¶ÔÏó.innerHTML ÊäÈëij¶ÔÏó±êÇ©ÖеÄhtmlÔ´´úÂë
innerText divid.innerText=xx ½«ÒÔdiv¶¨Î»ÒÔidÃüÃûµÄ¶ÔÏóÖµÉèΪXX
location.reload(); ʹ±¾Ò³Ë¢Ð£¬target¿ÉµÈÓÚÒ»¸öˢеÄÍøÒ³
Math.random() Ëæ»úºÊý,Ö»ÄÜÊÇ0µ½1Ö®¼äµÄÊý,Èç¹ûÒªµÃµ½ÆäËüÊý,¿ÉÒÔΪ*10,ÔÙ
È¡Õû
Math.floor(number) ½«¶ÔÏónumberתΪÕûÊý£¬ÉáÈ¡ËùÓÐСÊý
Math.min(1,2) ·µ»Ø1,2ÄĸöС
Math.max(1,2)
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
J
SON £¨JavaScript Object Notation£©Ò»ÖÖ¼òµ¥µÄÊý¾Ý¸ñʽ£¬±Èxml¸üÇáÇÉ¡£ JSON ÊÇ JavaScript ÔÉú¸ñʽ£¬ÕâÒâζ×ÅÔÚ JavaScript Öд¦Àí JSON Êý¾Ý²»ÐèÒªÈκÎÌØÊâµÄ API »ò¹¤¾ß°ü¡£
JSONµÄ¹æÔòºÜ¼òµ¥£º ¶ÔÏóÊÇÒ»¸öÎÞÐòµÄ“‘Ãû³Æ/Öµ’¶Ô”¼¯ºÏ¡£Ò»¸ö¶ÔÏóÒÔ“{”£¨×óÀ¨ºÅ£©¿ªÊ¼£¬“ ......
µÚ¶þÕ£ºECMAScript»ù´¡
1.µ±º¯ÊýÎÞÃ÷È··µ»Øֵʱ£¬·µ»ØµÄÒ²ÊÇÖµundefined
function testFunc(){}
alert(testFunc()==undefined);
2.typeof(null)=='object' //true,null¿ÉÒÔ½âÊÍΪ¶ÔÏóռλ·û
3.undefined ÊÇÉùÃ÷Á˱äÁ¿µ«Î´¶ÔÆä³õʼ»¯Ê±¸³Óè¸Ã±äÁ¿µÄÖµ£¬nullÔòÓÃÓÚ±íʾÉÐδ´æÔڵĶÔÏó¡£
alert(nu ......
¹¦ÄÜ£º
ÖØмÓÔØÎĵµ¡£
Óï·¨£º
location.reload(force)
²ÎÊý£º
force£º¿ÉÑ¡²ÎÊý£¬ÊÇÒ»¸ö²¼¶ûÖµ¡£
Èç¹ûÊ¡ÂÔ²ÎÊý£¬»òÕß²ÎÊýÊÇfalse£¬Ëü¾Í»áÓÃHTTPÍ·If-Modified-SinceÀ´¼ì²â·þÎñÆ÷ÉϵÄÎĵµÊÇ·ñÒѸı䡣Èç¹ûÎĵµÒѸÄ
±ä£¬reload()»áÔÙ´ÎÏÂÔظÃÎĵµ¡£Èç¹ûÎĵµÎ´¸Ä±ä£¬Ôò¸Ã·½·¨½«´Ó»º´æÖÐ ......
ÃæÏò¶ÔÏóµÄÓïÑÔ¶àÊý¶¼Ö§³Ö¼Ì³Ð£¬¼Ì³Ð×îÖØÒªµÄÓŵã¾ÍÊÇ´úÂ븴Ó㬴Ӷø¹¹½¨´óÐÍÈí¼þϵͳ¡£Èç¹ûÒ»¸öÀàÄܹ»ÖØÓÃÁíÒ»¸öÀàµÄÊôÐԺͻò·½·¨£¬¾Í³Æ֮Ϊ¼Ì³Ð¡£
´ÓÕâ¸ö½Ç¶ÈÀ´¿´¿´jsµÄ¼Ì³Ð·½Ê½¡£jsÖм̳з½Ê½ÓëдÀ෽ʽϢϢÏà¹Ø¡£²»Í¬µÄдÀ෽ʽÔì³É²»Í¬µÄ¼Ì³Ð·½Ê½¡£¸÷ÖÖÁ÷ÐÐjs¿â¼Ì³Ð·½Ê½Ò²¸÷²»Ïàͬ¡£´Ó×î¼òµ¥µÄ
¸´ÓÿªÊ¼¡£
1¡¢¹¹Ôìº ......