Msdn help:
MS-help: // Ms. VSCC. v90/ms. msdnqtr. v90.chs/dv_vwdcon/html/285e3a65-b42e-42c5-952d-baf184057899.htm
Type. registernamespace (" Demo "); Demo. Person = Function (Firstname, lastname, emailaddress ){ This . _ Firstname = firstname; This . _ Lastname = lastname; This . _ Emailaddress = emailaddress;} demo. Person. Prototype = {Getfirstname: Function (){ Return This . _ Firstname;}, getlastname: Function (){ Return This . _ Lastname;}, getemailaddress: Function (){ Return This . _ Emailaddress;}, setemailaddress: Function (Emailaddress ){ This . _ Emailaddress = emailaddress;}, getname: Function (){ Return This . _ Firstname + ''+ This . _ Lastname ;}, dispose: Function (){ Alert ('Bye' + This . Getname () ;}, Sendmail: Function (){ VaR Emailaddress = This . Getemailaddress (); If (Emailaddress. indexof ('@') <0) {emailaddress = emailaddress + '@ example.com ';} Alert ('Sending mail to '+ emailaddress + '...');}, Tostring : Function (){Return This . Getname () + '(' + This . Getemailaddress () + ')';} demo. Person. registerclass ('demo. person ', Null , SYS. idisposable );
Demo. Employee = Function (Firstname, lastname, emailaddress, team, title) {demo. employee. initializebase ( This , [Firstname, lastname, emailaddress]); This . _ Team = team; This . _ Title = title;} demo. employee. Prototype = {Getteam: Function (){ Return This . _ Team;}, setteam: Function (Team ){ This . _ Team = team;}, gettitle: Function (){ Return This . _ Title ;}, settitle: Function (Title ){ This . _ Title = title ;}, Tostring : Function (){ Return Demo. employee. callbasemethod (This ,' Tostring ') +' \ R \ n' + This . Gettitle () + '\ r \ n' + This . Getteam () ;}} demo. employee. registerclass ('demo. Employee ', demo. person );
The preceding example includes:
Namespaces, inheritance, attributes, and other related concepts
Reference: http://jsfkit.codeplex.com