origin
只读特性在
定位
接口是
USVString
containing the Unicode serialization of the origin of the represented URL
; that is:
http
or
https
, the scheme followed by
'://'
, followed by the domain, followed by
':'
, followed by the port (the default port,
80
and
443
respectively, if explicitely specified);
文件:
scheme, the value is browser dependant;
blob:
scheme, the origin of the URL following
blob:
. E.g
"blob:https://mozilla.org"
will have
"https://mozilla.org".
string = object.origin;
// On this page, returns the origin var result = window.location.origin; // Returns:'https://developer.mozilla.org'
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'origin' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
origin
|
Chrome Yes | Edge 12 |
Firefox
26
|
IE
11
|
Opera 10 |
Safari
Yes
|
WebView Android Yes | Chrome Android Yes |
Firefox Android
26
|
Opera Android ? | Safari iOS 5 | Samsung Internet Android Yes |
完整支持
兼容性未知
见实现注意事项。