当前页面: 开发资料首页 → Javascript 专题 → javascript手冊-b
javascript手冊-b
摘要: javascript
<textarea readonly style="border:none;font-family:Courier New;line-height:150%;width:760px;overflow-y:visible">
back method
Loads the previous URL in the history list.
语法
history.back()
用法
history
描述
This method performs the same action as a user choosing the Back button in the Navigator. The back method is the same as history.go(-1).
例子
The following custom buttons perform the same operations as the Navigator Back and Forward buttons:
<input TYPE="button" VALUE="< Back"
onClick="history.back()">
<input TYPE="button" VALUE="> Forward"
onClick="history.forward()">
See also
forward, go methods
bgColor property
A string specifying the color of the document background.
语法
document.bgColor
Property of
document
描述
The bgColor property is expressed as a hexadecimal RGB triplet or as one of the string literals listed in Color Values. This property is the JavaScript reflection of the BGCOLOR attribute of the <body> tag. The default value of this property is set by the user on the Colors tab of the Preferences dialog box, which is displayed by choosing General Preferences from the Options menu.
You can set the bgColor property at any time.
If you express the color as a hexadecimal RGB triplet, you must use the format rrggbb. For example, the hexadecimal RGB values for salmon are red=FA, green=80, and blue=72, so the RGB triplet for salmon is "FA8072".
例子
The following example sets the color of the document background to aqua using a string literal:
document.bgColor="aqua"
The following example sets the color of the document background to aqua using a hexadecimal triplet:
document.bgColor="00FFFF"
See also
alinkColor, fgColor, linkColor, and vlinkColor properties
big method
Causes a string to be displayed in a big font as if it were in a tag.
语法
stringName.big()
stringName is any string or a property of an existing object.
用法
string
描述
Use the big method with the write or writeln methods to format and display a string in a document.
例子
The following example uses string methods to change the size of a string: var worldString="Hello, world"
document.write(worldString.small())
document.write("" + worldString.big())
document.write("
" + worldString.fontsize(7))
The previous example produces the same output as the following htm:
Hello, world
Hello, world
Hello, world
See also
fontsize, small methods
blink method
Causes a string to blink as if it were in a