JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman

Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

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

Community Forum

Explore JavaScript

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.