1. Home
  2. Computing & Technology
  3. JavaScript
Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript

Time and Distance Calculator

Friday December 26, 2008
Sometimes a simple modification to an existing calculator can make it much more useful.

This JavaScript "calculator" will allow visitors to your site to obtain not only the distance between two cities (or other locations) but also an estimated travelling time for the journey by selecting the start and end points for their journey from two drop down lists. You can set up whatever locations that you like for the "calculator" simply by setting up the places, distances, and times between them in the array structure at the top of the JavaScript.

Time and Distance Calculator
Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss
Readers Respond
Ways I Have Seen JavaScript Misused And How I Would Have Done it Differently
Add Your Response

Recent Blog Posts
Explore JavaScript
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2010 About.com, a part of The New York Times Company.

All rights reserved.