Posts Tagged 'javascript'

What is JavaScript?

First and foremost JavaScript is a client side scripting language used to improve the usbability and functionality of web sites and web applications.

A simple example of this is client-side validation. Without client side validation, a programmer would have to process the contents of a form via a web server, and then send a response back if the form was completed incorrectly. JavaScript can eliminate this by simply validating the data directly in a web browser.

JavaScript is also not the best ...

Read more →

JavaScript Basics

Basics of JavaScript

This article was created to outline the basics of the JavaScript langauge.

JavaScript – Unsupported Browsers

When JavaScript is run in an unsupported browser, the script itself might be displayed as text within the browser. To prevent this from happening, it is best to use the HTML comment feature to comment out the code from the script.

For example:
<SCRIPT TYPE="text/javascript">

JavaScript program

HTML is commented ...

Read more →

Floating Point Numbers

Floating Point Numbers

While working on a JavaScript calculator I became stuck in what should be simple mathematics. The use of decimal points resulting in addition and subtraction caused erros in the calculations. The cause is in the way machine language calculates decimal points.

Oracle offers some great insight into the cause and resolution: What Every Computer Scientist Should Know About Floating-Point Numbers

The JavaScript Budget Calculator is a work in progress, to view how a machine interprets decimals check out ...

Read more →

Javascript Calculator

JavaScript Calculator

For a demo of the JavaScript calculator, click here
*You must have a JavaScript enabled browser for the JavaScript Calculator demo to work.

This calculator was created during a MindLeaders JavaScript tutorial. For more information on Mindreaders Tutorials and Training, go to:

JavaScript Calculator Source Code

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
<html xmlns=””>

<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” />
<title>JavaScript Calculator</title>
<script type=”text/javascript”>

var total = 0;
var lastOperation = “+”;
var newnumber = true;

function enterNumber(digit) {
Read more →