Mini-Introduction to objectorientated javascript
function class()
{
this.foo='foo'; //public member
var bar='bar'; //private member
alert("I'm a contstructor.");
this.baz=function () //public method
{
alert(bar); //accessing private member
alert(this.foo); //accessing public member
bam(); //calling private method
}
function foba()
{
alert("I'm so public");
}
this.foba=foba;
var bam=function() //private method
{
alert('Huchee!');
}
alert("I'm still a contstructor.");
}
var c=new class();
c.baz();
c.foba();
Embassies
-
Superhilfe, endlich mal ein Beispiel für objectorientiertes Javascript, das man versteht. Kurz, knapp ... super
Gruss
Sebastian -
Dito! Danke
Comment entry
Trackback(s)
A trackback is a kind of a source link. If i was finding an interesting entry in another blog, that i am commenting in my own blog, i am linking to the original message via the trackback. Has someone commented one of my entries in his/her weblog, you can find this link here under trackbacks, too. More informations about trackback are in the Wikipedia for example.
Trackback URL: http://geeks-have-feelings-too.net/trackback/mini-introduction-to-objectorientated-javascript/