Hi Rob,
Code:
<html>
<head>
<script type='text/javascript'>
var Series = new Array();
window.onload = function() {
var i;
Series[0] = new DataSeries(1,'fib', 'red', [3, 5, 8]);
Series[1] = new DataSeries(2, 'sq', 'white', [4, 9, 16]);
Series[2] = new DataSeries(3, 'pr', 'blue', [3, 5, 7]);
for (i = 0; i < Series.length; ++i) {
Series[i].show();
}
}
function DataSeries(type, name, color, points)
{
// Properties
this.type = type;
this.name = name;
this.color = color;
this.points = points;
// Methods
this.show = function()
{
alert(
'DataSeries\n' +
'type: ' + this.type + '\n' +
'name: ' + this.name + '\n' +
'color: ' + this.color + '\n' +
'points: ' + this.points);
}
} // end DataSeries
</script>
</head>
<body>
</body>
</html>
Bookmarks