I
Isa
Hi every one !
1. I would like to know why \t and \n are not recognize. Is there a
version of Js that we must specify ? Also why document.write(...) and
writeln(...) give the same result ? Isn't supposed to have a newline
with writeln?
2. I would like to know more about Object oriented in JS. Here is my
code and I would like to know why it's not working? What am I doing
wrong ?
function Rectangle(l, h) { // constructor
this.largeur = l;
this.hauteur = h;
}
var rect1 = new Rectangle(2,4);
document.writeln("area of rect1 " + rect1.area( ) ); //<- area is not
called or accessed :-(
function area( ) {
return this.largeur * this.hauteur;
}
Thank you very much !
1. I would like to know why \t and \n are not recognize. Is there a
version of Js that we must specify ? Also why document.write(...) and
writeln(...) give the same result ? Isn't supposed to have a newline
with writeln?
2. I would like to know more about Object oriented in JS. Here is my
code and I would like to know why it's not working? What am I doing
wrong ?
function Rectangle(l, h) { // constructor
this.largeur = l;
this.hauteur = h;
}
var rect1 = new Rectangle(2,4);
document.writeln("area of rect1 " + rect1.area( ) ); //<- area is not
called or accessed :-(
function area( ) {
return this.largeur * this.hauteur;
}
Thank you very much !