ÍøÒ³ÖÆ×÷ǰ̨֮JavascriptÊó±êʼþ
Èç¹ûÄãÍêÈ«²»¶®£¬ÄÇôÆÚÍû1-2ÖÜ¿´ÍêÒ»±éÀµ¹....²»Óÿ´µÄÌ«×Ðϸ£¬ºóÃæÔÙ¿´µ½²»¶®µÄʱºò»ØÍ·È¥¿´ÕâЩ¶«Î÷ºÃÁË¡£
1. Ç°ÑÔºÍ×¼±¸¹¤×÷
ÕâÀï²»»á½éÉÜʲôÈí¼þµÄÓ÷¨Ò»ÀàµÄ¶«Î÷¡£Èç¹û¾õµÃÊÖд´úÂëÊÇÔÚ×°µÄÈË¿ÉÒÔ³öÈ¥ÁË£¬Ð»Ð»¡£
Ê×ÏÈÄãÒªÓÐ̨µçÄÔ¡£È»ºóËüÓ¦¸Ã×°×Åwindows ºÍ IE¡£ÏÂÃæËù̸µ½µÄ´úÂ붼½öÔÚIE6.0ϵ÷ÊÔͨ¹ý£¬µ«ÊÇÎһᾡÁ¿Óñê×¼µÄд·¨¡£ÕâÀïÏȲ»×Ðϸ½éÉܼæÈÝÐÔÎÊÌâÁË£¬ÄÇÊÇÁíÒ»¸ö½Ì³ÌµÄÊÂÇé¡£ÎÒÏ°¹ßÓüÇʱ¾»òÕßUltraEditÀ´±à¼£¬Êµ¼ÊÉÏÈκÎÎı¾±à¼Æ÷¶¼¿ÉÒÔ£¬Ö»ÒªÄãϲ»¶¡£¾ßÌåÔõôÓÃÕâЩ¹¤¾ß¾Í²»ËµÁË£¬°³ÃǼӿìËٶȡ£
2. µÚÒ»¸öÀý×Ó
×öʲôºÃÄØ£¿°³ÃÇ´Ó×î¼òµ¥µÄ¿ªÊ¼°É....¸ø×Ô¼ºÒ»¸ö×÷¸öÌØЧÍæÍ棿...Èð³ÏëÏë....×öÒ»¸ö¿ÉÒÔÈӵķ½¿éÔõôÑù£¿¿ªÊ¼×öÁË...
2.1 ·½¿é
ÔËÐдúÂë¿ò
<div style="width:140px; height:140px; background-color:orange; cursor:pointer;"></div>
²»ÒªËµ°³ÔÚ·óÑÜ°¡£¬Íòʶ¼Óиö·Ç³£¼òµ¥µÄ¿ªÊ¼£¬¾ÍÏñ°³±»°³Ç°mmõßµôÒ»Ñù...
ps£º ϸÐĵÄÅóÓÑÒ²Ðí»á·¢ÏÖ°³µÄ cursor ÓõÄÊÇ pointer ¶ø²»ÊÇ hand£¬ÕâÊÇÒòΪhand ÊôÐÔ²»·ûºÏ±ê×¼¡£ËäÈ»°³Ö»ÎªIEд´úÂ룬µ«ÊDZ£³ÖºÃµÄÏ°¹ßÊDZØÒªµÄ¡£ÒÔºó´ËÀàÎÊÌâÒ»ÂÉÓà “(¼æ)”±ê¼Ç¡£
2.2 ¿ÉÒÔÍ϶¯µÄ·½¿é
2.21 °ó¶¨Êó±êʼþ£º°´Ï£¬Í϶¯£¬ÊÍ·Å£»»ñȡʼþÐÅÏ¢£ºÎ»Ö㬷¢ÉúµÄÔªËØ
ÔËÐдúÂë¿ò
<div style="width:140px; height:140px; background-color:pink; cursor:pointer;" id="divBlock" onmousedown="divBlock_event_mousedown();">I am a div.</div>
<script>
function divBlock_event_mousedown(){
document.onmousemove=document_event_mousemove;
var I_do_not_care=document.attachEvent?document.attachEvent("onmouseup",document_event_mouseup):document.addEventListener("mouseup",document_event_mouseup,"");
}
function document_event_mousemove(e){
var e, obj;
obj=document.getElementById("divBlock");
e=window.event?window.event:e;
obj.firstChild.nodeValue=e.clientX+":"+e.clientY;
}
function document_event_mouseup(e){
document.onmousemove="";
var I_do_not_care=document.detachEvent?document.detachEvent("onmouseup",document_event_mouseup):document.removeEventListener("mouseup",document_event_mouseup,"");
}
</script&
Ïà¹ØÎĵµ£º
¡¡javascriptº¯ÊýµÄ²ÎÊýÊÇ¿ÉÑ¡µÄ¡£ËüÓÐÏÂÃ漸¸öÌص㣺
¡¡¡¡£±.ÒòΪjavascript±¾ÉíÊÇÈõÀàÐÍ£¬ËùÒÔ£¬ËüµÄº¯Êý²ÎÊýҲûÓÐÀàÐͼì²éºÍÀàÐÍÏÞ¶¨£¬Ò»Çж¼Òª¿¿±à³ÌÕß×Ô¼ºÈ¥½øÐмì²é¡£
¡¡¡¡£².²ÎÊý¸öÊý²»¶¨¡£¾¡¹ÜÄãÒ²ÔÚÔÚº¯ÊýÉùÃ÷ʱ£¬ÓУ³¸ö²ÎÊý£¬¶øÔÚʵ¼ÊµÄʹÓÃÖУ¬Äã¿ÉÒÔ´«ÈÎÒâ¸ö²ÎÊý¸øÕâ¸öº¯Êý¡£ËüµÄʶ±ð½ö½öÊÇÒÀ¿¿º¯ÊýÃû£¬ÕâÓ ......
Èç¹ûÄãÏë½øÒ»²½Á˽âÈçºÎÓÃJavaScriptÀ´ÎªÍøÒ³Ìí¼Ó½»»¥ÐԵĻ°£¬ÄãÒ²ÐíÒѾÌý¹ýJavaScriptµÄʼþ´úÀí£¨event delegation£©ÁË£¬²¢ÇÒ»á¾õµÃÖ»ÓÐÄÇЩţ±ÆºæºæµÄJavaScript³ÌÐòÔ±²Å»á¹ØÐÄÕâÑù¸´ÔÓµÄÉè¼Æģʽ¡£ÊÂʵÉÏ£¬Èç¹ûÄãÒѾ֪µÀÔõôÑùÈ¥Ìí¼ÓJavaScriptµÄʼþ´¦ÀíÆ÷£¨event handler£©£¬ÊµÏÖʼþ´úÀíÒ²ÊǼþÇá¶øÒ×¾ÙµÄÊÂÇé¡£
J ......
"These memory leaks often
occur as a result of circular references between JavaScript objects and
objects within IE’s DOM (document object model)."
GPDE Team Blog
Ã÷ÏÔµÄDOM¶ÔÏóÓë JavaScript¶ÔÏóÑ»·ÒýÓúܺÃÅжϣ¬ÄѵÄÊÇÒþº¬µÄÑ»·ÒýÓÃÅжϣ¡
Òþº¬µÄÑ»·ÒýÓÃÐèҪͨ¹ý×÷ÓÃÓòÁ´½øÐзÖÎöÅÐ ......
javascript cookies²Ù×÷
<script>
//дcookiesº¯Êý ×÷ÕߣºµÔÕñ¿
function SetCookie(name,value)//Á½¸ö²ÎÊý£¬Ò»¸öÊÇcookieµÄÃû×Ó£¬Ò»¸öÊÇÖµ
{
var Days = 30; //´Ë cookie ½«±»±£´æ 30 Ìì
var exp = new Date(); //new Date("December 31, 9998");
&n ......