Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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×Ö· ......

JavascriptÃæÏò¶ÔÏó±à³Ì£¨¶þ£©£º¼Ì³Ð


ZT:http://www.ruanyifeng.com/blog/2010/05/object-oriented_javascript_inheritance.html
ÉÏÒ»´ÎµÄÎÄÕ£¬Ö÷Òª½éÉÜÁËÈçºÎ"·â×°"Êý¾ÝºÍ·½·¨£¬´ÓÔ­ÐͶÔÏóÉú³ÉʵÀý¡£
½ñÌìÒª½éÉܵÄÊÇ£¬¶à¸öÔ­ÐͶÔÏóÖ®¼äÈçºÎ"¼Ì³Ð"¡£
±ÈÈ磬ÏÖÔÚÓÐÒ»¸ö"¶¯Îï"¶ÔÏó£¬
¡¡¡¡function Animal(){
¡¡¡¡¡¡¡¡this.species = "¶¯Îï";
¡¡¡¡}
»¹ÓÐ ......

JavaScriptѧϰ±Ê¼Ç£¨Áù£©

1.DOMÊÇÕë¶ÔXMLµÄ»ùÓÚÊ÷µÄAPI¡£Ê¹ÓÃDOM£¬Ö»Ðè½âÎö´úÂëÒ»´ÎÀ´´´½¨Ò»¸öÊ÷µÄÄ£ÐÍ¡£ÔÚÕâ¸ö³õʼ½âÎö¹ý³ÌÖ®ºó£¬XMLÒѾ­Íêȫͨ¹ýDOMÄ£ÐͱíÏÖ³öÀ´£¬Í¬Ê±Ò²²»ÔÙÐèҪԭʼµÄ´úÂë¡£
   NB
£ºDOMÊÇÓïÑÔÎ޹صÄAPI£¬Ëü²¢²»ÓëJava¡¢JavaScript»òÆäËûÓïÑ԰󶨡£ ......

JavascriptÏÝÚå¡£¡£¡£¡£¡£¡£¡£

1.¸¡µãÔËËã
Õâ¿ÉÄÜÊÇ´ì°ÜһЩ¶Ôjavascript²»ÊìϤ²¢×¼±¸Ö´ÐÐһЩÊýѧÔËËãµÄÈ˵ÄÖ÷ÒªÔ­
Òò.
<script>  
alert(0.02 / 0.1);  //0.19999999999999998 
  
alert(1.14 * 100);  //113.99999999999999    ;)
  
......

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

Dynamic Scopes  ¶¯Ì¬×÷ÓÃÓò
    Both the with statement and the catch clause of a try-catch statement, as well as a function containing eval_r(), are all considered to be dynamic scopes. A dynamic scope is one that exists only through execution of code and therefore cannot be det ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ