Hi all again,
i have read tutorial about javascript classical inheritance Douglas Crockford wrote. But i did an example for the reason practizing as it showed in his page http://www.crockford.com/javascript/inheritance.html
for ex i did the following example.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function Parenizor(value) {
this.setValue(value);
}
Parenizor.method('setValue', function (value) {
this.value = value;
return this;
});
Parenizor.method('getValue', function () {
return this.value;
});
Parenizor.method('toString', function () {
return '(' + this.getValue() + ')';
});
myParenizor = new Parenizor(0);
myString = myParenizor.toString();
alert(myString);
</script>
</head>
<body>
</body>
</html>
But it doesnt work. it shows an error. maybe wherever i did mistake. If possible please help to find out problem. Thanks inadvance for attention