B
bizt
Hi,
Below I have a simple object / function thing (still getting head
round these) declaration:
function MyObject() {
this.alertMe = function() {
alert('hello');
};
this.alertMeAgain() {
this.alertMe(); // wrong syntax
};
}
Notice how in the method - alertMeAgain - I have attempted to call the
other public function, alertMe(). Now this doesnt work as I have come
to know - how do I call internal methods from another methods with the
same object??
Also, I pretty new to using custom objects in js. Is this the most
common method of building objects in js? I come from using PHP which
uses a quite similar means of declaring classes so I like this one.
Cheers
Burnsy
Below I have a simple object / function thing (still getting head
round these) declaration:
function MyObject() {
this.alertMe = function() {
alert('hello');
};
this.alertMeAgain() {
this.alertMe(); // wrong syntax
};
}
Notice how in the method - alertMeAgain - I have attempted to call the
other public function, alertMe(). Now this doesnt work as I have come
to know - how do I call internal methods from another methods with the
same object??
Also, I pretty new to using custom objects in js. Is this the most
common method of building objects in js? I come from using PHP which
uses a quite similar means of declaring classes so I like this one.
Cheers
Burnsy