自己写的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+")\"> </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();
    
     
	
	
    
    
	相关文档:
        
    
    1.在HTML中使用<script>元素引入JavaScript。
   该元素有两个属性,language声明要使用的脚本语言,src属性是可选的,用于引用外部JavaScript文件。
   NB
:现在大多使用type属性(type=“text/javascript”)替代language属性,以便更好地支持XHTML(可扩展HTML)。
2.一般认为 ......
	
    
        
    
    **
* 我在网上看到过很多BASE64的JavaScript算法,都觉得不满意,于是自己写了一个,在这里分享一下。
* 我的代码在质量的效率都较高,没有一些冗余的操作。总体来讲我觉得非常不错。
* 如果大家有什么不懂的地方可以问我。
*/
var BASE64={
    /**
     * 此变量为编码的 ......
	
    
        
    
    1.DOM是针对XML的基于树的API。使用DOM,只需解析代码一次来创建一个树的模型。在这个初始解析过程之后,XML已经完全通过DOM模型表现出来,同时也不再需要原始的代码。
   NB
:DOM是语言无关的API,它并不与Java、JavaScript或其他语言绑定。 ......
	
    
        
    
    1.浮点运算
这可能是挫败一些对javascript不熟悉并准备执行一些数学运算的人的主要原
因.
<script>  
alert(0.02 / 0.1);  //0.19999999999999998 
  
alert(1.14 * 100);  //113.99999999999999    ;)
  
 ......
	
    
        
    
    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 ......