运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<html>
2
<head>
3
<title>添加Prototype对象方法</title>
4
<script language="JavaScript">
5
// 对象的构造函数
6
function circle(r, color){
7
   this.r = r;
8
   this.color = color;
9
   this.display = showCircle;
10
}
11
// 对象方法
12
function showCircle(){
13
   document.write("半径 : " + this.r + "<br>");
14
   document.write("色彩 : " + this.color + "<br>");
15
   document.write("圆周率 : " + this.PI + "<br><hr>");
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
在JavaScript中添加Prototype对象的方法
分类
网站常用
描述
在JavaScript中添加Prototype对象的方法,Prototype是一款优秀的JS框架库,用它可创建超丰富的JavaScript前端交互应用,是实现Ajax功能的良好工具,一般情况下,它的使用都离不开JS的引用,本代码就实现了如何使用JS引入Prototype。
收藏