Image

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

Core client-side JavaScript object.

Description

The Image object represents an image that was created with the <img> tag. Images can be downloaded and cached dynamically by using the Image() constructor, but they cannot be displayed using the constructor. The constructor takes two optional arguments, width and height. The argument width specifies the width of the image in pixels, while the argument height specifies the height of the image in pixels. If these arguments are larger or smaller than the actual image, the image will be stretched to these dimensions. You have probably noticed that there is no argument specifying the image to load. The image to load is specified ...

Get Pure JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.