HTML and CSS Reference
In-Depth Information
History Object
The History object keeps track of the pages that have been visited. Table G-13
summarizes the History object property and methods.
Table G-13 History Object
Property
Description
current
URL of the current document
length
Contains the specific number of documents that have been opened during the current
browser session
next
URL of the next document in the history array
previous
URL of the previous document in the history array
Method
Function
back()
Equivalent to clicking a Web browser's Back button
forward()
Equivalent to clicking a Web browser's Forward button
go(n)
Opens a specific document in the history list indicated by n (n is an integer or a URL)
toString()
Returns history in a string format
Image Object
The Image object represents images created using the <img> tag. Table G-14
summarizes the Image object properties and events.
Table G-14 Image Object
Property
Description
border
Read-only property containing border width, in pixels, as specified by border attribute of <img>
tag, including if an error occurs during loading
complete
Boolean value that returns true when an image is completely loaded
height
Read-only property containing height of image as specified by height attribute of <img> tag
hspace
Read-only property containing amount of horizontal space, in pixels, to left and right of image, as
specified by hspace attribute of <img> tag
name
Name assigned to tag (results are unpredictable because name attribute is deprecated in HTML5)
src
URL of displayed image
vspace
Read-only property containing amount of vertical space, in pixels, above and below image, as
specified by vspace attribute of <img> tag
width
Read-only property containing width of image as specified by width attribute of <img> tag
Event
Description
onabort
User cancels the loading of an image, usually by clicking the Stop button
onerror
Error occurs while loading image
onload
Image finishes loading
JSON Object
The JSON object (JavaScript Object Notation) provides the capability of inserting
data in a script without using XML. Table G-15 shows two examples of how to represent
JSON data, and Table G-16 summarizes JSON methods.
Search WWH ::




Custom Search