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

JavaScriptʼþ

JavaScriptʼþ·ÖÀࣺ
1¡¢²¶»ñÐÍ£¨IE²»Ö§³Ö£©£¨´ÓDOM½á¹¹µÄ×¶Ë¿ªÊ¼ÏòÏÂÑÓÉ죩
2¡¢Ã°ÅÝÐÍ£¨´ÓDOM½á¹¹µÄ×îµÍ¶ËÏòÉÏÒ»¼¶¼¶ÑÓÉ죩
¡¾IE7ÒÔÉÏ¿ÉÒÔ¸ø‘html’Ìí¼Óonclickʼþ£¬IEÖÐbody->html£¬»ðºüÖÐhtml->body¡¿
JavaScriptÌí¼Óʼþ¼àÌý£º
1¡¢IE£º
[object].attachEvent("event_handler", fnHandler);
[object].detachEvent("event_handler", fnHandler);
µ±Ìí¼Ó¶à¸öʼþ¼àÌýº¯Êýʱ£¬ºóÌí¼ÓµÄÏȵ÷Ó㬵«²¢·ÇÑϸñÉϵÄÏȺó˳Ðò¡£
2¡¢±ê×¼DOMµÄ¼àÌý·½·¨
[object].addEventListener("event_name", fnHandler, bCapture);
[object].removeEventListener("event_name", fnHandler, bCapture);
µ±Ìí¼Ó¶à¸öʼþ¼àÌýº¯Êýʱ£¬ÏÈÌí¼ÓµÄÏȵ÷Ó㬶øÇÒÑϸñ°´ÏȺó˳ÐòÖ´ÐС£
JavaScriptʼþ¶ÔÏó
ÔÚIE ä¯ÀÀÆ÷ÖÐʼþ¶ÔÏóÊÇwindow ¶ÔÏóµÄÒ»¸öÊôÐÔevent£¬·ÃÎÊʱͨ³£²ÉÓÃÈçÏ·½·¨¡£
oP.onclick = function(){
var oEvent = window.event;
}
¾¡¹ÜËüÊÇwindow ¶ÔÏóµÄÊôÐÔ£¬µ«event ¶ÔÏó»¹ÊÇÖ»ÄÜÔÚʼþ·¢Éúʱ±»·ÃÎÊ£¬ËùÓеÄʼþ´¦Àíº¯ÊýÖ´ÐÐÍêÖ®ºó£¬¸Ã¶ÔÏó¾ÍÏûʧÁË¡£
¶ø±ê×¼µÄDOM Öй涨event ¶ÔÏó±ØÐë×÷ΪΩһµÄ²ÎÊý´«¸øʼþ´¦Àíº¯Êý£¬Òò´ËÔÚÀàËÆFirefox ä¯ÀÀÆ÷ÖзÃÎÊʼþ¶ÔÏóͨ³£½«Æä×÷Ϊ²ÎÊý£¬´úÂëÈçÏ£º
oP.onclick = function(oEvent){
}
Òò´ËΪÁ˼æÈÝÁ½ÖÖä¯ÀÀÆ÷£¬Í¨³£²ÉÓÃÏÂÃæµÄ·½·¨¡£
oP.onclick = function(oEvent){
if(window.event) oEvent = window.event;
}


Ïà¹ØÎĵµ£º

javascript ʵÏÖTab»¬¶¯

Ïȸø³ö»ù±¾µÄHTMLÎļþ£º
<ul>
  <li id="m01"></li>
  <li id="m01"></li>
  <li id="m01"></li>
</ul>
<div>
 <div id="C01"> </div>
 <div id="C02">&n ......

ÓÃJavascriptÁ¬½ÓAccessÊý¾Ý¿âµÄ·½·¨

±¾ÎĽéÉÜjavascriptÁ¬½ÓaccessÊý¾Ý¿âµÄ·½·¨¡£Õâ¶Î´úÂëÔÚ±¾µØ¿ÉÒÔÕý³£ÔËÐУ¬ÔÚÏßÔòÐèÒª×ã¹»µÄȨÏÞ¡£ÓÉÓÚ²ÉÓÃAccessÊý¾Ý¿â£¬ËùÒÔ²¢²»Ê¹Óñê×¼µÄSQLÓ﷨ʹÓÃʱ¡£ÐèҪעÒâ¡£
Õ⼸Ìì·ÑÁËͦ´óÁ¦ÆøÔÚÍøÉϲéÕÒjavascriptÁ¬½ÓaccessÊý¾Ý¿âµÄ·½·¨£¬¾­¹ýÕûÀí×ܽᣬÖÕÓÚд³öÒ»¶ÎÄܹ»ÓÐЧִÐеĴúÂë¡£
µ«ÊÇÕâ¶Î´úÂëÔÚ±¾µØ¿ÉÒÔÕý³£ÔËÐУ ......

Javascript¿ÉÒƶ¯´°¿ÚµÄÉè¼Æ

<html>
 <head><title>js¿ÉÒƶ¯´°¿ÚµÄÉè¼Æ</title>
<script  language="javascript">
var x0=0,y0=0,x1=0,y1=0;//³õʼ»¯È«¾Ö±äÁ¿
var offx=6,offy=6;
var moveable=false;
var hover='orange';//color;
var index=10000;//z-index;
//¹Ø±Õ´°¿Ú
function closeWin(id)
{& ......

javascript withÓ÷¨(ת)

with
(object)
   statements
²ÎÊý
object
еÄĬÈ϶ÔÏó¡£
statements
Ò»¸ö»ò¶à¸öÓï¾ä£¬object ÊǸÃÓï¾äµÄĬÈ϶ÔÏó¡£
˵Ã÷
with
Óï¾äͨ³£ÓÃÀ´Ëõ¶ÌÌض¨ÇéÐÎϱØÐëдµÄ´úÂëÁ¿¡£ÔÚÏÂÃæµÄÀý×ÓÖУ¬Çë×¢Òâ Math µÄÖظ´Ê¹Óãº
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * ......

ÔÚJavascriptÖд´½¨¶ÔÏó

ÔÚJavascriptÖÐûÓÐclassÀ࣬µ«ÊÇͬÑùÒ²¿ÉÒÔ½øÐжÔÏóµÄ´´½¨¡£ÔÚÃæÏò¶ÔÏóµÄÓïÑÔÖÐÐèҪʵÀý»¯Ä³¸ö¾ßÌåÀàµÄʵÀý£¬ÔÚJavascriptÖÐÔò²»Óá£
ÔÚJavascriptÀ¶ÔÏñ¿ÉÒÔ´´½¨ÐµĶÔÏó£¬Ò²¿ÉÒԼ̳Ð×ÔÆäËû¶ÔÏó¡£Õâ¸ö¸ÅÄî³ÆΪԭÐÍ»¯¼Ì³Ð(prototypal inheritance)¡£
Èκκ¯ÊýÔÚJavascript Öж¼¿ÉÒÔ±»ÊµÀý»¯Ò»¸ö¶ÔÏó¡£
³ÌÐòÈçÏ£º
// ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ