我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
您也可以阅读此文章的English (US)版。
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The URLUtilsReadOnly interface defines utility methods to work with URLs. It defines only non-modifying methods intended to be used on data that cannot be changed.
There are no object of this type, but several interface are implemented it, like WorkerLocation.
Properties
This interface doesn't inherit any property.
URLUtilsReadOnly.hrefRead only- Is a
DOMStringcontaining the whole URL. URLUtilsReadOnly.protocolRead only- Is a
DOMStringcontaining the protocol scheme of the URL, including the final':'. URLUtilsReadOnly.hostRead only- Is a
DOMStringcontaining the host, that is the hostname, a':', and the port of the URL. URLUtilsReadOnly.hostnameRead only- Is a
DOMStringcontaining the domain of the URL. URLUtilsReadOnly.originRead only- Returns a
DOMStringcontaining the canonical form of the origin of the specific location. URLUtilsReadOnly.portRead only- Is a
DOMStringcontaining the port number of the URL. URLUtilsReadOnly.pathnameRead only- Is a
DOMStringcontaining an initial'/'followed by the path of the URL. URLUtilsReadOnly.searchRead only- Is a
DOMStringcontaining a'?'followed by the parameters of the URL. URLUtilsReadOnly.hashRead only- Is a
DOMStringcontaining a'#'followed by the fragment identifier of the URL.
Methods
This interface doesn't inherit any method.
URLUtilsReadOnly.toString()- Returns a
DOMStringcontaining the whole URL. It is a synonym forURLUtilsReadOnly.href.
Specifications
| Specification | Status | Comment |
|---|---|---|
| URL The definition of 'URLUtilsReadOnly' in that specification. |
Living Standard | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | No support [1] | 3.5 (1.9.1) | No support [1] | No support [1] | No support [1] |
origin |
? | 29 (29) | ? | ? | ? |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | No support [1] | No support [1] | 1.0 (1.9.1) | No support [1] | No support [1] | No support [1] |
origin |
? | ? | 29.0 (29) | ? | ? | ? |
[1] Though not grouped in a single abstract interface, these methods are directly available on the interfaces that implement it, if this interface is supported.
See also
- Other URL-related interfaces:
URL,URLUtils, andURLQuery. - Interfaces implementing this one:
WorkerLocation.