水贴
javascript吧
全部回复
仅看楼主
level 7
荧光小妹 楼主
RT
2011年07月30日 05点07分 1
level 7
荧光小妹 楼主
function Circle (xPoint, yPoint, radius) {
this.pi=3.14;
this.x = xPoint; // 圆心的 x 坐标。
this.y = yPoint; // 圆心的 y 坐标。
this.r = radius; // 圆的半径。
this.perimeter=2*this.pi*this.r;
this.area=this.pi*this.r*this.r;
this.toString="我是一个圆,圆心在("+this.x+","+
this.y+"),半径长度是"+this.r+"周长是"+
this.perimeter+"面积是"+this.area;
function fun (str) {
alert("..."+str);
return "123"+str;
}
this.haha = fun; // 计算圆面积的函数现在是 Circle Prototype 对象的一个方法。
}
2011年07月30日 05点07分 2
level 7
荧光小妹 楼主
function showJSON() {
var user =
{
"username":"andy",
"age":20,
"info": { "tel": "123456", "cellphone": "98765"},
"address":
[
{"city":"beijing","postcode":"222333"},
{"city":"newyork","postcode":"555666"}
],
"fun":function fun(){
alert("wo sh user");
}
}
alert(user.username);
alert(user.age);
alert(user.info.cellphone);
alert(user.address[0].city);
alert(user.address[0].postcode);
user.fun();
}

2011年07月30日 05点07分 3
level 9
[拍砖]这么厉害!
2011年07月30日 06点07分 4
level 11
学习了,膜拜高手
2011年07月30日 08点07分 5
level 7
荧光小妹 楼主
水贴都有人回 有木有天理啊[拍砖]
2011年07月30日 09点07分 6
level 3
无语!
2011年07月30日 13点07分 7
1