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

JAVASCRIPT¶¯Ì¬µÄΪԪËØÌí¼Óʼþ

ÏÖÔڸоõjsºÜºÃºÜÇ¿´ó£¬Ëæ×ÅÉîÈëµÄѧϰ£¬Äã¾Í»á²»»á¾Ü¾øÔÚ¿Í»§¶ËʹÓÃjs¡£Ö®Ç°Ò²ÔÚÍøÉÏÕÒÁ˵ã×ÊÁÏ£¬Ò»Æð¿´¿´¡£
 
value="ÎÒÊÇ button" /> 
¶¯Ì¬Ìí¼Óonclickʼþ£º 
<input type="button" value="ÎÒÊÇ button" id="bu"> 
<script type="text/javascript"> 
var bObj=document.getElementById("bu"); 
bObj.onclick= objclick; 
function objclick(){alert(this.value)}; 
</script> 
Èç¹ûʹÓÃÄäÃûº¯Êý function(){}£¬ÔòÈçÏÂÃæËùʾ£º 
<input type="button" value="ÎÒÊÇ button" id="bu"> 
<script type="text/javascript"> 
var bObj=document.getElementById("bu"); 
bObj.onclick=function(){alert(this.value)}; 
</script> 
ÉÏÃæµÄ·½·¨ÆäʵԭÀí¶¼Ò»Ñù£¬¶¼ÊǶ¨Òå onclick ÊôÐÔµÄÖµ¡£ÖµµÃ×¢ÒâµÄÊÇ£¬Èç¹û¶à´Î¶¨Òå obj.onclick£¬ÀýÈ磺obj.onclick=method1; obj.onclick=method2; obj.onclick=method3£¬ÄÇôֻÓÐ×îºóÒ»´ÎµÄ¶¨Òåobj.onclick=method3²ÅÉúЧ£¬Ç°Á½´ÎµÄ¶¨Ò嶼¸ø×îºóÒ»´ÎµÄ¸²¸ÇµôÁË¡£ 
ÔÙ¿´ IE ÖÐµÄ attachEvent£º 
<input type="button" value="ÎÒÊÇÀ­µÇ" id="bu"> 
<script type="text/javascript"> 
var bObj = document.getElementById("bu"); 
bObj.attachEvent("onclick",method1); 
bObj.attachEvent("onclick",method2); 
bObj.attachEvent("onclick",method3); 
function method1(){alert("µÚÒ»¸öalert")} 
function method2(){alert("µÚ¶þ¸öalert")} 
function method3(){alert("µÚÈý¸öalert")} 
</script> 
Ö´ÐÐ˳ÐòÊÇ method3 > method2 > method1 £¬ÏȽøºó³ö£¬Óë¶ÑÕ»ÖеıäÁ¿ÏàËÆ¡£ÐèҪעÒâµÄÊÇattachEvent ÖеÚÒ»¸ö²ÎÊýÊÇon¿ªÍ·µÄ£¬¿ÉÒÔÊÇ onclick/onmouseover/onfocus µÈµÈ 
¾Ý˵(δ¾­È·ÈÏÑéÖ¤)ÔÚ IE ÖÐʹÓà attachEvent ºó×îºÃÔÙʹÓà detachEvent À´ÊÍ·ÅÄÚ´æ 
ÔÙ¿´¿´ Firefox ÖÐµÄµÄ addEventListener£º 
<input type="button" value="ÎÒÊDz¼Ê²" id="bu"> 
<script type="text/javascript"> 
var bObj = document.getElementById("bu"); 
bObj.addEventListener("click",method1,false); 
bObj.addEventListener("click",met


Ïà¹ØÎĵµ£º

ÓÃJavascriptÀ´²Ù×÷Cookie

ÍøÕ¾¾­³£Óõ½µÄÒ»¸ö¶«Î÷ÓÃÀ´ÔÝ´æһЩÏà¹ØÐÅÏ¢µÄCookieÓÐÓŵãÒ²ÓÐȱµã£¬ËüÄܹ»²»Õ¼Ó÷þÎñÆ÷×ÊÔ´£¬´æ´¢ÔÚ¿Í»§¶ËµÄµçÄÔÀ¿ÉÕâÑùÒ²ÓÐÒ»¶¨µÄΣÏÕÐÔ£¬ÒòΪÏà¹ØÐÅÏ¢±ÈÈç˵µÇ¼ij¸öÍøÕ¾µÄÓû§ÃûºÍÃÜÂëÖ®ÀàµÄÐÅÏ¢£¬¶¼»á´æÔÚ¿Í»§¶ËµÄµçÄÔÀÕâÑù»á±»Ä³Ð©“ÓÐÐÄÖ®ÈË”ÀûÓã¬ËùÒÔ£¬ÓÐЩÈËÏ°¹ßÔÚ¹«¹²³¡ºÏʹÓÃÍêµçÄÔºóÇåµôCo ......

JavaScript ½âÎö¶ÁÈ¡XMLÎĵµ


JavaScript½âÎö¶ÁÈ¡XMLÎļþ£¬Ö÷Òª¾ÍÊǼÓÔز¢½âÎöXMLÎļþ£¬È»ºó¾Í¿ÉÒÔ²âÊÔ½âÎöµÄXMLÎļþµÄÄÚÈÝ£¬´òÓ¡Êä³öÀ´¡£
±àдÁËÒ»¸öJavaScriptµÄÀàÀ´ÊµÏÖ¶ÁÈ¡Ò»¸öXMLÎļþÖеÄÊý¾Ý£¬ÊµÏÖ´úÂëÈçÏÂËùʾ£º
<mce:script type="text/javascript"><!--

/**
* @author Shirdrn
*/
function XMLDoc(){}; // ¶¨ÒåÒ»¸öXM ......

javascript °ü¹ü½Úµã

Ä£·ÂjQuey£¬´´½¨¼¸¸ö°ü¹ü½ÚµãµÄ·½·¨£¬·¢ÏÖjQueryµÄ·½·¨ºÜµÍЧ°¡£¬ÏÂÒ»´ÎËûÓÖ¿ÉÒÔ˵Õ⼸¸ö·½·¨¿ÉÒÔÌáÉýÁ˶àÉÙ¶àÉÙÁË¡£Ô­Àí»ù±¾ÊÇÕâÑù£¬Èç¹û´«ÈëµÄÊÇ×Ö·û´®£¬ÄÇôÈÃËüÃDZä³ÉÒ»¸öÔªËؽڵ㣬²»¹ýÕâÔªËؽڵãÒ²¿ÉÒÔÓÐÐí¶à²ã£¬ÔÚ×îÄÚ²ã°ÑÒª°ü¹üµÄÔªËطŽø¡£°Ñ×Ö·û´®±ä³ÉÔªËؽڵãµÄ·½·¨ÓÐÈçϼ¸¸ö¡£1£¬createElement£¬IE¿ÉÒÔÁ¬ÔªËØÊ ......

JavaScriptʵÏÖˮƽѡÏЧ¹û

Ê×ÏÈÔÚbodyÖмÓÈëÒÔÏÂHTMLÄÚÈÝ£º
<div id="panel">
 <div id="top">
        <ul id="menu">
            <li id="1">Home</li>
 &nbs ......

ÓÐ¹Ø JavaScript µÄ 10 ¼þÈÃÈ˷ѽâµÄÊÂÇé

JavaScript ¿ÉËãÊÇÊÀ½çÉÏ×îÁ÷Ðеıà³ÌÓïÑÔ£¬ËüÔø±» Web ¿ª·¢Éè¼ÆʦÌùÉÏجÃεıêÇ©£¬ËäÈ»ÕæÕýµÄجÃÎÆäʵÊÇ DOM API£¬Õâ¸ö±»´óÁ¿µÄ¿ª·¢ÓëÉè¼ÆʦËæÊÖÄéÀ´ÔöÇ¿ËûÃÇµÄ Web Ç°¶ËµÄ½Å±¾ÓïÑÔ£¬Èç½ñÔ½À´Ô½±»ÖØÊÓ£¬ËäÔòÈç´Ë£¬JavaScript ÈÔȻӵÓкܶàÈÃÈ˷ѽâµÄ¶«Î÷¡£
1. ËüÒÔ Java ÃüÃû£¬µ«²¢²»ÊÇ Java
Ëü×î³õ½Ð Mocha£¬ ½ÓןÄÃûÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ