i cant see why this wont work do you see why? i am studying a video by vtc and it works for the guy on the pc. here is the html button.
the bugzilla error im getting is
missing ; before statement
[Break on this error] CashRegister.prototype = New Machine();\n
performtest is not defined
onclick(click clientX=0, clientY=0)
<input type="button" name="PerformTest" value="Perform Test" onclick="javascript
:performtest()">
here is the performtest function in a seperate js file
Code:
function Machine()
{
this.startingCash = 0;
this.usedbyemployee = "Employee has not been assigned";
}
function CashRegister()
{
this.startingcash = 1000;
this.tax = .07;
}
CashRegister.prototype = New Machine();
CashRegister.prototype.getStartingCash = function()
{
return this.startingCash;
}
CashRegister.prototype.getUsedByEmployee = function()
{
return this.usedbyemployee;
}
function performtest()
{
var myCashRegister = new CashRegister();
alert("The Starting Cash is: " + myCashRegister.getStartingCash());
alert("The Used by Employee Cash is: " + mycashregister.getusedbyemployee();
}