<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    
<title>javascript类的定义</title>
    
<script type="text/javascript">
        
function Go(s){this.Init(s)};//创建类
        Go.prototype={//定义属性与方法
          step:0,
          start:
0,
          kill:{b:
0,w:0},//创建ArrayList
          Rend:function(){
            alert(
'Rend');
          },
          Init:
function(s){
            
this.step=s;
          }
        }
        
function f(){
            
var g = new Go(1);
            g.Rend();
            alert(g.step);
            alert(g.kill[
'b']);
        }
    
</script>
</head>
<body>
    
<input type="button" value="ok" onclick="f();" />
</body>
</html>

相关文章:

  • 2021-07-17
  • 2021-09-03
  • 2022-12-23
  • 2022-03-09
  • 2021-05-21
  • 2021-06-07
猜你喜欢
  • 2021-12-05
  • 2021-06-03
  • 2021-07-01
  • 2021-09-19
  • 2021-08-28
相关资源
相似解决方案