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

×Ô¼ºÐ´µÄjavascriptÎå×ÓÆå

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>five-in-a-raw</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style>
 <!--
  table{text-align: center;font-size: 20px;cursor: hand;empty-cells: show;table-layout: fixed;}
 -->
 </style>
  </head>
  <script type="text/javascript">
 <!--
 function FiveRawGame(){
  this.redChess="<font color=\"red\">X</font>";
  this.blackChess="<font color='black'>O</font>";
  //³õʼ»¯ÆåÅ̺ÍÊý¾Ý
  this.init=function(){
   var str="<table  width=\"600\" height=\"600;\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"  >";
   for(var i=0;i<25;i++){
    str+="<tr height='7'>";
    for(var j=0;j<25;j++){
     str+="<td id='r"+i+"c"+j+"' onclick=\"FiveRawGame.chess("+i+","+j+")\" onmouseover=\"FiveRawGame.showMsg("+i+","+j+")\">&nbsp;</td>";
    }
    str+="</tr>";
   }
   str+="</table>";
   document.getElementById("main").innerHTML=str;
   this.allGrids=new Array();
   for(var a=0;a<25;a++){
    this.allGrids[a]=new Array();
   }
   for(var i=0;i<25;i++){
    for(var j=0;j<25;j++){
     this.allGrids[i][j]=new grid(i,j,"O");
    }
   }
   this.isChess=true;
   this.redArr=new Array();
   this.blackArr=new Array();
   this.allArr=new Array();


Ïà¹ØÎĵµ£º

javascriptЧÂʾ­Ñé̸(Ò»)

±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔ­À´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾­Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾­¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷Ô­Òò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......

Èç¹ûÔÚCHtmlDialogÖе÷ÓÃJavascriptº¯Êý

// µ÷ÓÃÒ³ÃæµÄˢз½·¨
     IHTMLWindow2* pWindow;
     IHTMLDocument2*   pDocument; 
     HRESULT hr = GetDHtmlDocument(&pDocument);  
     hr = pDocument->get_pa ......

[·­Òë]High Performance JavaScript(006)

Identifier Resolution Performance  ±êʶ·ûʶ±ðÐÔÄÜ
    Identifier resolution isn't free, as in fact no computer operation really is without some sort of performance overhead. The deeper into the execution context's scope chain an identifier exists, the slower it is to access for ......

[·­Òë]High Performance JavaScript(010)

Cloning Nodes  ½Úµã¿Ë¡
    Another way of updating page contents using DOM methods is to clone existing DOM elements instead of creating new ones—in other words, using element.cloneNode() (where element is an existing node) instead of document.createElement().
 &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ