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

JavaScriptµÄʼþ´úÀí

Èç¹ûÄãÏë½øÒ»²½Á˽âÈçºÎÓÃJavaScriptÀ´ÎªÍøÒ³Ìí¼Ó½»»¥ÐԵϰ£¬ÄãÒ²ÐíÒѾ­Ìý¹ýJavaScriptµÄʼþ´úÀí£¨event delegation£©ÁË£¬²¢ÇÒ»á¾õµÃÖ»ÓÐÄÇЩţ±ÆºæºæµÄJavaScript³ÌÐòÔ±²Å»á¹ØÐÄÕâÑù¸´ÔÓµÄÉè¼ÆÄ£Ê½¡£ÊÂʵÉÏ£¬Èç¹ûÄãÒѾ­ÖªµÀÔõôÑùÈ¥Ìí¼ÓJavaScriptµÄʼþ´¦ÀíÆ÷£¨event handler£©£¬ÊµÏÖʼþ´úÀíÒ²ÊǼþÇá¶øÒ×¾ÙµÄÊÂÇé¡£
JavaScriptʼþÊÇËùÓÐÍøÒ³½»»¥ÐԵĸù»ù£¨ÎÒÖ¸µÄÊÇÕæÕýµÄ»¥¶¯ÐÔ£¬¶ø²»½öÊÇÄÇЩCSSµÄÏÂÀ­²Ëµ¥£©¡£ÔÚ´«Í³µÄʼþ´¦ÀíÖУ¬Äã°´ÕÕÐèҪΪÿһ¸öÔªËØÌí¼Ó»òÕßÊÇɾ³ýʼþ´¦ÀíÆ÷¡£È»¶ø£¬Ê¼þ´¦ÀíÆ÷½«ÓпÉÄܵ¼ÖÂÄÚ´æÐ¹Â¶»òÕßÊÇÐÔÄÜϽµ——ÄãÓõÃÔ½¶àÕâÖÖ·çÏÕ¾ÍÔ½´ó¡£JavaScriptʼþ´úÀíÔòÊÇÒ»ÖÖ¼òµ¥µÄ¼¼ÇÉ£¬Í¨¹ýËüÄã¿ÉÒÔ°Ñʼþ´¦ÀíÆ÷Ìí¼Óµ½Ò»¸ö¸¸¼¶ÔªËØÉÏ£¬ÕâÑù¾Í±ÜÃâÁ˰Ñʼþ´¦ÀíÆ÷Ìí¼Óµ½¶à¸ö×Ó¼¶ÔªËØÉÏ¡£
ËüÊÇÔõôÔË×÷µÄÄØ£¿
ʼþ´úÀíÓõ½ÁËÁ½¸öÔÚJavaSciprtʼþÖг£±»ºöÂÔµÄÌØÐÔ£ºÊ¼þðÅÝÒÔ¼°Ä¿±êÔªËØ¡£µ±Ò»¸öÔªËØÉϵÄʼþ±»´¥·¢µÄʱºò£¬±ÈÈç˵Êó±êµã»÷ÁËÒ»¸ö°´Å¥£¬Í¬ÑùµÄʼþ½«»áÔÚÄǸöÔªËØµÄËùÓÐ׿ÏÈÔªËØÖб»´¥·¢¡£ÕâÒ»¹ý³Ì±»³ÆÎªÊ¼þðÅÝ£»Õâ¸öʼþ´ÓÔ­Ê¼ÔªËØ¿ªÊ¼Ò»Ö±Ã°Åݵ½DOMÊ÷µÄ×îÉϲ㡣¶ÔÈκÎÒ»¸öʼþÀ´Ëµ£¬ÆäÄ¿±êÔªËØ¶¼ÊÇÔ­Ê¼ÔªËØ£¬ÔÚÎÒÃǵÄÕâ¸öÀý×ÓÖÐÒ²¾ÍÊǰ´Å¥¡£Ä¿±êÔªËØËüÔÚÎÒÃǵÄʼþ¶ÔÏóÖÐÒÔÊôÐÔµÄÐÎʽ³öÏÖ¡£Ê¹ÓÃʼþ´úÀíµÄ»°ÎÒÃÇ¿ÉÒÔ°Ñʼþ´¦ÀíÆ÷Ìí¼Óµ½Ò»¸öÔªËØÉÏ£¬µÈ´ýʼþ´ÓËüµÄ×Ó¼¶ÔªËØÀïðÅÝÉÏÀ´£¬²¢ÇÒ¿ÉÒԺܷ½±ãµØÅжϳöÕâ¸öʼþÊÇ´ÓÄĸöÔªËØ¿ªÊ¼µÄ¡£
Õâ¶ÔÎÒÓÐʲôºÃ´¦ÄØ£¿
ÏëÏóÒ»ÏÂÏÖÔÚÎÒÃÇÓÐÒ»¸ö10ÁС¢100ÐеÄHTML±í¸ñ£¬ÄãÏ£ÍûÔÚÓû§µã»÷ijһµ¥Ôª¸ñµÄʱºò×öµãʲô¡£±ÈÈç˵ÓÐÒ»´ÎÎÒ¾ÍÐèÒªÈñí¸ñÖеÄÿһ¸öµ¥Ôª¸ñÔÚ±»µã»÷µÄʱºò±ä³É¿É±à¼­×´Ì¬¡£Èç¹û°Ñʼþ´¦ÀíÆ÷¼Óµ½Õâ1000¸öµ¥Ôª¸ñ½«»á²úÉúÒ»¸öºÜ´óµÄÐÔÄÜÎÊÌ⣬²¢ÇÒÓпÉÄܵ¼ÖÂÄÚ´æÐ¹Â¶ÉõÖÁÊÇä¯ÀÀÆ÷µÄ±ÀÀ£¡£Ïà·´µØ£¬Ê¹ÓÃʼþ´úÀíµÄ»°£¬ÄãÖ»ÐèÒª°ÑÒ»¸öʼþ´¦ÀíÆ÷Ìí¼Óµ½tableÔªËØÉϾͿÉÒÔÁË£¬Õâ¸öº¯Êý¿ÉÒ԰ѵã»÷ʼþ¸ø½ØÏÂÀ´£¬²¢ÇÒÅжϳöÊÇÄĸöµ¥Ôª¸ñ±»µã»÷ÁË¡£
ÓôúÂëд³öÀ´µÄ»°ÊÇʲôÑùÄØ£¿
´úÂëºÜ¼òµ¥£¬ÎÒÃÇËùÒª¹ØÐĵÄÖ»ÊÇÈçºÎ¼ì²âÄ¿±êÔªËØ¶øÒÑ¡£±È·½ËµÎÒÃÇÓÐÒ»¸ötableÔªËØ£¬IDÊÇ“report”£¬ÎÒÃÇΪÕâ¸ö±í¸ñÌí¼ÓÒ»¸öʼþ´¦ÀíÆ÷ÒÔµ÷ÓÃeditCellº¯Êý¡£editCellº¯ÊýÐèÒªÅжϳö´«µ½tableÀ´µÄʼþµÄÄ¿±êÔªËØ¡£¿¼Âǵ½ÎÒÃÇҪдµÄº¯ÊýÖпÉÄÜ»áÖØ¸´Óõ½ÕâÒ»¹¦ÄÜ£¬ËùÒÔÎÒÃǰÑËüµ¥¶À·Åµ½Ò»¸öÃûΪgetEventTargetµÄº¯ÊýÖУº
function getEventTarget(e


Ïà¹ØÎĵµ£º

javascript»ù´¡ÖªÊ¶¡¾×îÏ꾡¡¿

1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script> 
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(&ldquo ......

javascript½ØÈ¡Â·¾¶ÖеÄÎļþÃû

<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type"&nb ......

ActiveX×é¼þÓëJavaScript½»»¥

2007-10-24 23:55
1£®ÔÚCOM×é¼þÖе÷ÓÃJavaScriptº¯Êý
// Á¬½Óµã·½Ê½Ò³Ãæjavascript½Å±¾
<object classid="CLSID:B568F111-DFE4-4944-B67F-0728AB2AB30F" id="testCom" VIEWASTEXT></object>
<script language="JavaScript" for="testCom" event="staTe(s)">
      &n ......

javascriptµÄwindows.open²ÎÊýѧϰ


<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
file://д/³ÉÒ»ÐÐ
-->
</SCRIPT>
²ÎÊý½âÊÍ£º
<SCRIPT LANGUAGE="javascript"&g ......

(×ªÔØ)javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ


 
[ 2007-8-6 17:03:00 | By: ibrahim ]
 
javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ

ÏÈÀ´¿´¿´options¼¯ºÏµÄÕ⼸¸ö·½·¨£º
options.add(option)·½·¨Ïò¼¯ºÏÀïÌí¼ÓÒ»Ïîoption¶ÔÏó£»
options.remove(index)·½·¨ÒƳýoptions¼¯ºÏÖеÄÖ¸¶¨Ï
options(index)»òoptions.item(index)¿ÉÒÔͨ¹ýË÷Òý»ñÈ¡options¼¯º ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ