madman
12-26-2002, 07:38 PM
hi people
i am a student learning javascript and as part of my assignment we have to create some javascript objects. we have to create a webpage using javascript, most of the webpage should be created automatically by javascript and to that we been told to create objects for employees, lectuers and modules. i have created a object for employee, i wanted to know is this the right way of going for this assignment, i would be greatfull if anyone could sugest any ideas or any improvement for this code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function Employee (id, name, dept, website, fileMc, pcMc) {
this.id = 00111
this.name = john
this.dept = Computing
this.username = "ku" + this.id
this.website = website || ("http://www.someurl.ac.uk/~" + this.username)
this.fileMc = fileMc || ("file://something.someurl.ac.uk/~" + this.username)
}
//-->
</script>
</head>
<body>
</body>
</html>
Thanks
i am a student learning javascript and as part of my assignment we have to create some javascript objects. we have to create a webpage using javascript, most of the webpage should be created automatically by javascript and to that we been told to create objects for employees, lectuers and modules. i have created a object for employee, i wanted to know is this the right way of going for this assignment, i would be greatfull if anyone could sugest any ideas or any improvement for this code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function Employee (id, name, dept, website, fileMc, pcMc) {
this.id = 00111
this.name = john
this.dept = Computing
this.username = "ku" + this.id
this.website = website || ("http://www.someurl.ac.uk/~" + this.username)
this.fileMc = fileMc || ("file://something.someurl.ac.uk/~" + this.username)
}
//-->
</script>
</head>
<body>
</body>
</html>
Thanks