MSc-IT Study Material
June 2010 Edition

Computer Science Department, University of Cape Town

Server-side and client-side image maps

The implementation of image maps requires the processing of the mouse click coordinates in conjunction with knowing the image areas and their associated hypertext links. The processing can take place in one of two places:

Originally, the only option for processing image maps was to do so on the server. However, later versions of HTML have added features allowing client-side processing. Many people are now developing their new pages (and updating older pages) to process image maps in the Web browser itself, thus reducing the amount of processing required by the server.

Server-side image maps

Server-side image mapping uses images, .map files and CGI scripts. Often server-side image maps use the Imagemap programme.

The programme processing image maps needs to be on the server, usually in the cgi-bin/ directory.

The HREF attribute of server side imagemaps is always a hyperlink to the cgi-bin directory:

<a href="/cgi-bin/imagemap/user_dir/image.map">

<img src="/user_dir/image.gif">

</a>
      

In fact, the HREF path can sometimes be interpreted as a combination of two paths:

  • The location of the "imagemap" programme, such as /cgi-bin/imagemap

  • The location of the (coordinate) map for the image, user_dir/image.map. This describes the various areas of the image.

A major disadvantage of server-side image maps is that their implementation can differ between different server systems. This means that the author of the website using image maps needs to communicate closely with the Web server's administrator to ensure that the maps work correctly.

Since there are so many advantages to client-side imagemaps, and almost all current browser versions support them, we shall not explore server-side image maps further in this unit (although most image map programmes still provide features to output/edit server-side map files).

Client-side image maps

Clients-side image maps have a number of advantages over server-side maps.

  • Reduced server load, since the mapping is done on the client.

  • There is no need to communicate with server side scripts.

  • The user can see the image maps associated hypertext URLs in the status bar of their browser before clicking.