<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js实现对象</title>
<script language="javascript">
function CreateObject(vname,vage,url)
{
var obj=new Object;
obj.name=vname;
obj.age=vage;
obj.url=url;
obj.say=function()
{
document.write(vname+vage+url)
}
return obj;
}
var p=CreateObject('ggyy',18,'http://www.pc1024.com');
p.say()
</script>
</head>
<body>
</body>
</html>

被折叠的 条评论
为什么被折叠?



