1. Computing

Distance Calculator

1. Introduction and Sample

More of this Feature

Get the Code Modify the Code

If you have a travel related web site or any kind of site where your visitors are interested in distances then this distance calculator may be just the addition you are looking for to put on your site.

The following example displays the distances between a small number of cities in Europe but the script can be easily adapted to work with any locations simply by entering the names of the locations and the distance (in kilometres) between them into a multi-dimensional array. The script simply requires starting and destination cities to be selected and the distance between them will be extracted from the array and displayed.

Starting City:
Destination City:
Distance (kilometres):
Distance (Miles):

If you want to add a copy of this distance calculator to your site then the first thing you need to do is to get the HTML and Javascript.

Related Video
Zip File 101
Computer Cable Ports 101

©2013 About.com. All rights reserved.