I cannot stop running into problems with this code. I figure I'm doing something monumentally wrong, and I figure asking people who know what they're doing would be the best thing to do.
The actual "problem" or assignment is to create a simple TV object. It has three characteristics. Make one. Call it. Display all the characteristics. Then it's done.
I declare variables and make a constructor. As per the rules of the assignment, both of these things must remain in the header of the document.
Next is the body. I want to create a new television object, called myTV, with those parameters. I create a function to recall the data back. Then I actively call the data back.
Somewhere along the lines I have logic problems, possible syntax problems, and who knows what else. My mind is reeling from staring at the same code for so long, so I'm going to grab something to drink and check back here in like 15. ugh.
<html>
<head>
<script type="text/javascript">
var manuTV;
var sizeTV;
var priceTV;
function Television(manu, size, price){
this.manuTV = manu;
this.sizeTV = size;
this.priceTV = price;
}
</script>
</head>
<body>
<script type="text/javascript">
var myTV = new Television("Sony", 52, 999);
function DisplayInfo(){
document.write("Television Manufacturer: " + this.manuTV + "<br />");
document.write("Size(in inches)" + this.sizeTV + "<br />");
document.write("Price:" + this.priceTV + "<br />");
}
myTV.displayInfo();
</script>
</body>
</html>