<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd“>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=GB2312″ />
<title>javascript类设计模式</title>
<script language=”JavaScript” type=”text/javascript”>
function car(){
//构造函数
}
car.prototype = {
wheel:3,
run:function(){
alert(”我在跑”);
},
stop:function(){
alert(”我停止了”);
}
}
var car = new car();
car.stop1();
</script>
</head>
<body>
</body>
</html>
看看代码就OK了咯