Advertisement
Guest User

Daniel Trebbien

a guest
May 26th, 2010
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Model.Foo = function() {
  2.     // private stuff
  3.     var a, b;
  4.  
  5.     // method which accesses the variable `a`
  6.     this.func = function() {
  7.         window.alert(a);
  8.     };
  9.  
  10.     // public properties
  11.     this.attr1 = '';
  12.     this.attr2 = '';
  13. };
  14.  
  15. Model.Foo.prototype = {
  16.     func1 : function() { /* ... */},
  17.     func2 : function() { /* ... */}
  18.     //,other prototype functions
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement