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

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 / 1
March 25, 2009
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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