Server-side Image Map Module


 

Reference: *Server-side Image Map Module at the W3C

Elements in this Module

The Server-side Image Map Module declares only attributes.

Attributes Declared on Elements in Other Modules

The Server-side Image Map Module declares additional attributes on elements in other Modules.

Attribute(s)Element(s)
ismapimg, input type="image"

Description

The Server-side Image Map Module is used to create an image map within a document where a server-side handler performs a different action for different pixel coordinates clicked (activated) within an image. The user agent sends these coordinates to the handler for processing. This is in contrast to a client-side image map (see the Client-side Image Map Module) where the user agent itself processes the coordinates and determines which link to follow based upon information detailed within an associated map element.

Note: Non-graphical user agents (which do not allow the user to select specific coordinates) should send the coordinates 0,0 to the server (and it is wise to assume that some may omit them altogether) so any handler should include suitable fallback functionality for these cases.

A server-side image map can be created using either an img element or an input type="image" element.

Using an img Element

If using an img element, it should be given the attribute ismap="ismap" and be enclosed within an a element. In a graphical user agent, the pixel coordinates are appended to the URI specifed in the href attribute of the a element as the query string ?xpos,ypos (e.g. ?121,36). Here xpos is the x pixel coordinate (from the left of the image) and ypos is the y pixel coordinate (from the top of the image).

Using an input type="image" Element

In a graphical browser, if a user clicks (activates) an input type="image" element (which acts as a graphical submit button for a form) the parameters
imgname.x=xpos and imgname.y=ypos should be sent by the user agent to the processing server along with the rest of the form data. Here, imgname is the value of the name attribute of the input type="image" element and, as above, xpos is the x pixel coordinate (from the left of the image) and ypos is the y pixel coordinate (from the top of the image): e.g. pos.x=43 and pos.y=106 for name="pos". These coordinate parameters are included whether or not the ismap attribute is specified (at least in all user agents I've used). In fact, the ismap attribute is not valid on the input type="image" element for XHTML 1.0 code, so if compatibility is desired between XHTML 1.1 and XHTML 1.0, I can only conclude that it should be omitted entirely.


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Module Index (XHTML 1.1) > Server-side Image Map Module (XHTML 1.1)