
07-07-2006, 18:59
|
|
|
|
חבר מתאריך: 12.03.06
הודעות: 102
|
|
|
לא מבין מה לא טוב בקוד הזה, תעזרו אני משתגע!
שלום.
כתבתי איזה קוד בJS ואני שובר את הראש כבר שעה ולא מבין למה זה לא טוב, הנה:
<html>
<head>
</head>
<body>
<SCRIPT language="JavaScript">
function slimshady (height , width )
{
this.Height=height;
this.Width=width;
this.getperimeter=perimeter;
this.getarea=area;
}
Bigx = new slimshady(5 , 3) ;
Smallx = new slimshady(2 ,2 );
function area()
{
return (slimshady.Height*slimshady.Width);
}
function perimeter()
{
return ((slimshady.Height*2)+(slimshady.Width*2)) ;
}
document.write("Bigx perimeter : " + Bigx.perimeter +"<BR>"+"<BR>");
document.write("Smallx getarea: " + Smallx.area);
</SCRIPT>
</body>
</html>
שעה בלי להגזים....
וככה כמעט כל דף שאני כותב, יאללה, איזו שפה מעצבנת, אין איזה דיבגר טוב או משהו?? הורדתי את FIRE BUG לפיירפוקס אבל אין שם כלום...
|