锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
]]>
1.榪愯鏃舵坊鍔犵殑浜嬩歡涓嶄細琚厠闅嗭紝濡備笅渚嬶細
浣滅敤鍩熸槸涓涓娊璞℃蹇碉紝鍦ㄦ祻瑙堝櫒鐨凧avaScript瀹炵幇涓細鏈夎繖涓蹇碉紝浣嗘槸涓嶅悓嫻忚鍣ㄥ疄鐜板彲鑳戒笉鍚屻?br />
涓銆佷綔鐢ㄥ煙鐨勭綾伙紙鑷繁鎰熸偀錛?br />
1.瀵硅薄浣滅敤鍩燂紝window鍙婃爣絳懼厓绱犻兘灞炰簬瀵硅薄浣滅敤鍩熴?br />
2.鍑芥暟浣滅敤鍩燂紝鍑芥暟鑷韓褰㈡垚鐨勪綔鐢ㄥ煙銆?br />
鍙互鎶婁綔鐢ㄥ煙鐪嬩綔鏄笂涓嬫枃錛坈ontext錛変箣綾葷殑瀵硅薄銆?br />
鐪嬩笅闈㈢殑浠g爜
渚?
Gets a value that indicates whether standards-compliant mode is switched on for the object.
Syntax
[ sMode = ] object.compatMode
Possible Values
sMode String that receives one of the following values. BackCompat
Standards-compliant mode is not switched on.CSS1Compat
Standards-compliant mode is switched on.The property is read-only. The property has no default value.
Remarks
With Microsoft Internet Explorer 6 and later, you switch on standards-compliant mode by including the !DOCTYPE declaration at the top of your document, specifying a valid Label in the declaration, and in some cases, specifying the Definition or URL. The Label element specifies the unique name of the Document Type Definition (DTD), and can be appended with the version number of the DTD. The Definition element specifies the definition of the DTD that is specified in the Label. The URL element specifies the location of the DTD.
When standards-compliant mode is switched on (also called "strict mode"), Windows Internet Explorer displays the document according to the World Wide Web Consortium (W3C) Cascading Style Sheets (CSS)
standard. When standards-compliant mode is not switched on (also called "quirks mode"), the document is displayed as it was displayed in previous versions of Internet Explorer.
The compatMode property is deprecated in Internet Explorer 8 in favor of the documentMode property.
IE8 documentMode
Syntax
[ vMode = ] object.documentMode
Possible Values
vMode Floating-point that receives one of the following values. 5
Microsoft Internet Explorer 5 mode (also known as "quirks mode").7
Internet Explorer 7 Standards mode.8
Internet Explorer 8 Standards mode.The property is read-only. The property has no default value.
Remarks
This property is available in all compatibility modes.
The document compatibility mode of a Web page determines how Internet Explorer 8 interprets and renders the page. Page authors generally use meta elements to specify
X-UA-Compatible
HTTP-EQUIV headers that specify the document compatibility mode. For more information, see Defining Document Compatibility. In versions of Internet Explorer previous to Internet Explorer 8, compatMode was solely determined by DOCTYPE.
Finally, note that any number, string, or boolean value can be
converted to its corresponding wrapper object with the Object( )
function:
var number_wrapper = Object(3);
Value |
Context in which value is used |
|||
---|---|---|---|---|
|
String |
Number |
Boolean |
Object |
Undefined value |
"undefined" |
NaN |
false |
Error |
null |
"null" |
0 |
false |
Error |
Nonempty string |
As is |
Numeric value of string or NaN |
TRue |
String object |
Empty string |
As is |
0 |
false |
String object |
0 |
"0" |
As is |
false |
Number object |
NaN |
"NaN" |
As is |
false |
Number object |
Infinity |
"Infinity" |
As is |
true |
Number object |
Negative infinity |
"-Infinity" |
As is |
TRue |
Number object |
Any other number |
String value of number |
As is |
true |
Number object |
true |
"true" |
1 |
As is |
Boolean object |
false |
"false" |
0 |
As is |
Boolean object |
Object |
toString( ) |
valueOf( ), toString( ), or NaN |
true |
As is |
鍒╃敤涓婇潰鐨勮〃錛屾垜浠彲浠ョ煡閬搃f ("") 銆乮f (0)銆乮f (undefined)銆乮f (null)銆乮f (NaN)錛岃繖浜沬f璇彞鐨勬潯浠墮兘涓篺alse.