";str+="年龄:"+age+"
";str+="性别:"+gender;document.write(str);}"">
function Lakers() {
this.name = "kobe bryant";
this.age = "28";
this.gender = "boy";
}
var people=new Lakers();
with(people)
{
var str = "姓名: " + name + "<br>";
str += "年龄:" + age + "<br>";
str += "性别:" + gender;
document.write(str);
}
原文地址:http://codejson.blog.51cto.com/10074045/1910552