What's the difference between client-side and server-side imagemaps?
In order for an image on the web to contain a link to more than one destination, it must have an imagemap. The imagemap defines regions of the image and associates each region with a different link.
Two kinds of imagemaps exist, server-side and client-side. In the server-side method, when you click an image leading to multiple links, you are actually invoking a cgi-bin program. The program typically reads a separate map file that tells the program where to go depending on what part of the image you are clicking. The program returns the destination to the web browser, which then opens the page. The imagemap is server-side because the web browser had to contact the remote host to know which site it should contact.
Client-side imagemaps, in contrast, do not require a cgi-bin program to function. The imagemap is actually an HTML construct that can be contained on the same page as the clickable image. Rather than the program on the remote host figuring out what site to go to, the web browser itself knows what regions of the image are associated with what sites. Thus, the browser rather than the remote host is interpreting the imagemap.
Client-side imagemaps are usually faster than server-side imagemaps and, in general, are easier to create. Their main disadvantage is that older browsers (e.g., Netscape Navigator prior to version 2.0), and less fully featured ones, may not support them. Fortunately, it is usually possible to create a clickable image that can have both a server-side and a client-side imagemap.
Also see:
- How do I make server-side imagemaps?
- How do I make client-side imagemaps?
- How do I create customized error messages for my web page?
Last modified on January 22, 2008.






