DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Create A JavaScript Object The JSAN Way

09.01.2005
| 905 views |
  • submit to reddit
        <pre>
if (!this.AA) AA = {};

AA = function()
{
}

AA.prototype =
{
       test: function()
       {
               document.writeln("test");
       }
}

blah = new AA();

blah.test();
</pre>