Home arrow HTML arrow Using the Keyboard with a Web Page Calculator

Using the Keyboard with a Web Page Calculator

In this fourth part of a six-part series on building a web page calculator, we'll delve more deeply into the functions. We start with the operator(ID) function, and then take a closer look at events. We'll wrap up by starting to show how to use the keyboard with the calculator.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
March 25, 2009
  1. · Using the Keyboard with a Web Page Calculator
  2. · The First Code Segment
  3. · The second Code Segment
  4. · Events and the Keyboard

print this article

Using the Keyboard with a Web Page Calculator
(Page 1 of 4 )

Details of the operator(ID) Function

This function uses three global variables. These variables are:

//argument for top level JavaScript eval() function

var evalString = ""

//the memory (store) is a variable

var memVar = "";

//after the operation +, -, X and /, the display has to be cleared. We need for this the variable

var toClearDisplay = false;

I talked about these variables before. It suffices here to read the comments. I will come back to the global variables after I explain the operator() function. The operator function has two code segments.

blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials