Login required to edit - Edit - MDC, Talk:Main Page - MDC, , Properly Configuring Server MIME Types - MDC, DOM:window.escape - History - MDC, Login required to edit - Edit - MDC, Category:DHTML - MDC, Image:Firefoxlogo.png - MDC, MDC:Existing Content - MDC, Login required to edit - Edit - MDC

XUL:image

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Interfaces ]

An element that displays an image, much like the HTML img element. The src attribute can be used to specify the URL of the image.

More information is available in the XUL tutorial.

Attributes
onerror, onload, src, validate
Properties
accessible, src
Style classes
alert-icon, error-icon, message-icon, question-icon
[edit]

Examples

Image:Firefoxlogo.png
<image src='Firefoxlogo.png' width='135' height='130'/>
[edit]

Attributes

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

onerror
Type: script code
This event is sent to an image element when an error occurs loading the image.

onload
Type: script code
This event handler will be called on the image element when the image has finished loading. This applies whether the image is applied via the src attribute or the list-style-image style property. If you change the image, the event will fire again when the new image loads. This event will not bubble up the element tree.

src
Type: URL
The URL of the content to appear in the element.

validate
Type: one of the values below
This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:
  • always: The image is always checked to see whether it should be reloaded.
  • never: The image will be loaded from the cache if possible.


[edit]

Properties

accessible
Type: nsIAccessible
Returns the accessibility object for the element.

src
Type: URL
Gets and sets the value of the src attribute.

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

[edit]

Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[edit]

Style classes

alert-icon
Class that adds an alert icon. This typically looks like an exclamation mark. This and the other icon classes may be used by image elements or other elements which can have an image.

error-icon
Class that adds an error icon. This will typically be a red "X" icon.

message-icon
Class that adds a message box icon.

question-icon
Class that adds a question icon, which usually looks like a question mark.


[edit]

Interfaces

nsIAccessibleProvider, nsIDOMXULImageElement

Retrieved from "http://developer.mozilla.org/en/docs/XUL:image"