HTML and CSS Reference
In-Depth Information
When the user clicks someplace within the image, the browser passes
the coordinates of the mouse pointer along with the URL specified in the
<a>
tag to the document server. The server uses the mouse-pointer co-
ordinates to determine which document to deliver back to the browser.
When
ismap
is used, the
href
attribute of the containing
<a>
tag must
contain the URL of a server application or, for some HTTP servers, a re-
lated map file that contains the coordinate and linking information. If
the URL is simply that of a conventional document, errors may result,
and the desired document probably will not be retrieved.
The coordinates of the mouse position are screen pixels counted from
the upper-left corner of the image, beginning with (0,0). The browser
adds the mouse coordinates, preceded by a question mark, to the end
of the URL.
For example, if a user clicks 43 pixels over and 15 pixels down from the
upper-left corner of the image displayed from the following link:
<a href="/cgi-bin/imagemap/toolbar.map">
<img ismap src="pics/toolbar.gif">
</a>
the browser sends the following search parameters to the HTTP server:
/cgi-bin/imagemap/toolbar.map?43,15
In the example,
toolbar.map
is a special image-map file located inside
the
cgi-bin/imagemap
directory and containing coordinates and links. A
special image-map process uses that file to match the passed coordin-
ates (43,15 in our example) and return the selected hyperlink docu-
ment.