标签:meta oct doctype cal name var lang 面向对象 htm
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script> (function () { var n = "me"; function people(name){ this.oo=name; } people.prototype.say= function () { alert("poe-hello"+this.oo+n) }; window.people=people; return n; }()); (function () { function student(name){ this.oo=name; } student.prototype=new people(); var sups=student.prototype.say; student.prototype.say= function () { sups.call(this); alert("stu-hello"+this.oo); } window.student=student; }()); var s=new student("ii"); s.say(); </script> </body> </html>
标签:meta oct doctype cal name var lang 面向对象 htm
原文地址:http://www.cnblogs.com/bengbengbengbengbeng/p/6575646.html