View Single Post
Old 06-15-2008, 07:14 PM   #1 (permalink)
sarmenhb
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 255
Thanks: 39
sarmenhb is on a distinguished road
Default beginning js and getting errors.

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();

}
__________________
http://www.sarmenhb.com
Send a message via AIM to sarmenhb Send a message via MSN to sarmenhb Send a message via Yahoo to sarmenhb Send a message via Skype™ to sarmenhb
sarmenhb is offline  
Reply With Quote