@BrainEaterMar 03.2006 — #function CustomObject(){ var privateVar='private'; var self=this; this.publicVar='public'; function privateFunc(){alert('private functions can access variable and functions,n both '+privateVar+' and '+self.publicVar+' (though theynneed the "self" trick to get the public/priviledge ones)')} this.priviledgedFunc=function(){ alert('priviledged functions can access variable and functions,n both '+privateVar+' and '+this.publicVar) privateFunc() } } CustomObject.prototype.publicFunc=function(){ try{ alert('public functions can access variable and functions,n both '+privateVar+' and '+this.publicVar) } catch(error){ alert('public functions can only access variablesnand functions that are '+this.publicVar+'. Trying tonget private variables gives the error:n"'+error.toString()+'"') } }
@gert_cuykensauthorMar 03.2006 — #i understand but it is so different from php and when using php to generate javascript its like driving a car from europe to england where europe is php and england js ?