<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <script language="JavaScript"> <!-- function P(name) { if (!(this instanceof P)) return new P(name); //return new P(arguments); //var _this = this === window ? {} : this; var _this = this; _this.name = name; } P.prototype.show = function () { alert(this.name + ‘_‘ + this.T); } P.prototype.T = ‘6‘ var a = new P(‘a‘); a.show(); var b = P(‘b‘); b.show(); a.show(); //--> </script> </head> <body> </body> </html>
时间: 2024-10-15 04:38:37