TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-15-2008, 06:14 PM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
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();

}
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 06-15-2008, 06:26 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The missing ; before statement error was being generated because your New should not be capitalised, new Machine() works just fine. There are also a number of other errors mostly centred around improper capitalisation of the method/instance names.
Salathe is offline  
Reply With Quote
Old 06-15-2008, 08:26 PM   #3 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

one word: Firebug

It's the only reason I use firefox. You'll understand when you start using it. Get the older version though, the new one kinda sucks.
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 06-16-2008, 02:55 AM   #4 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

The only reason?

How about better support for all the current w3c recommendations? Or less memory leaks? Or just... it's plain better.
-m
delayedinsanity is offline  
Reply With Quote
Old 06-21-2008, 03:51 AM   #5 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

There are browsers with better support

memory leaks? Have you checked the memory that firefox uses normally? It's more than hours of leaks off IE.

As for your last argument, that's just an opinion. Internet Explorer does it's job well; it surfs the web. Even if as a developer I hate IE, as an internet user it serves my needs perfectly.

I'm not even getting into Opera, Safari, Konquerer, Epiphany, or Dillo.
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:32 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design