ThreeClicks.com

The way to get to where you want to go today.

▄ ThreeClicks.com . . . We do Windows
Home
Virus and Computer Safety
Windows Power Toys
Power Toys for IE 5
Pop-Up Stopper
Tiny Applications
Compressing Wave Files
Adding Sounds to a Web Page
Java Script Samples
Frequently Asked Questions
Do I Need My Own Web Site?
AOL Timer Killer
411 Online Phonebooks
Reverse Phone Directory
Fast Find on the WWW
Shared Links and Guestbook
Newsletter 9/9/99
LQQK Can you handle the truth?
 
 

Behind the Curtain

Where I might say a few words from time to time to notify visitors of changes or additions.
Yeah, right.

Or maybe I will just comment on some current event.

A policy of an eye for an eye, will only lead to everyone being blind.

Pay no attention to that man behind the curtain.

oz@threeclicks.com

 

Contact Us | Search | About Us     
<script type="text/javascript"><!-- google_ad_client = "pub-4366881223256375"; /* 728x90, created 7/30/08 */ google_ad_slot = "0345444379"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
Ľ Java Script Calculator

[ Java Script Calculator ] Java Script Magic 8 Ball ] Java Script Popup Windows ] Java Script Toys and Games ] Email Code ] Java Script Buttons ]

Samples: Calculator

 
 

 
 

ThreeClicks.com


How Does This Sample Work?
The calculator is an HTML table containing button controls. The buttons themselves are intrinsic <INPUT> style buttons, not Microsoft« ActiveX« controls. Microsoft« JScript« code is attached to the OnClick event for these buttons. The display is simply an intrinsic <INPUT> style text box. 
Notice the variable declared at the beginning of the <SCRIPT> tag, outside of any procedure: 


<SCRIPT LANGUAGE="JavaScript">
<!-- 
// Module-level variables
var FKeyPad = document.Keypad;
var Accum = 0; // Previous number (operand) awaiting operation
var FlagNewNum = false; // Flag to indicate a new number (operand) is being entered
var PendingOp = ""; // Pending operation waiting for completion of second operand
. . . view source for the rest ▄

These are module-level variables that persist for as long as the page is loaded. By contrast, variables declared within a procedure cease to exist as soon as the procedure exits. Thus, module-level variables can be used to store values that must persist between invocations of a procedure. Module-level variables are also visible to all procedures, and so are useful when multiple procedures need to share values. 

Hit Counter


<script type="text/javascript"><!-- google_ad_client = "pub-4366881223256375"; /* 728x90, created 7/30/08 */ google_ad_slot = "0345444379"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
ThreeClicks.com and Oz@ThreeClicks.com are trademarks of ThreeClicks.com, Inc.
Sarasota, Florida 34231 USA 
Other products mentioned may be trademarks of their respective companies.


Questions or problems regarding this web site should be directed to oz@threeclicks.com
Copyright ę 1997 - ThreeClicks.com. All rights reserved.
TERMS OF USE
 

| RELOAD^ TOP | < BACK |     

........ Think Correctly  ▄ ........ Think Correctly  ▄ ........ Think Correctly  ▄