| Package | gecko |
| Class | public class nsIURI |
| Inheritance | nsIURI Object |
| Property | Defined By | ||
|---|---|---|---|
| asciiHost : DOMString [read-only]
The URI host with an ASCII compatible encoding. | nsIURI | ||
| asciiSpec : DOMString [read-only]
The URI spec with an ASCII compatible encoding. | nsIURI | ||
| host : DOMString
The host is the Internet domain name to which this URI refers. | nsIURI | ||
| hostPort : DOMString
The "host : port" part of the URI (or simply the host, if port is -1). | nsIURI | ||
| originCharset : DOMString [read-only]
The charset of the document from which this URI originated. | nsIURI | ||
| password : DOMString
The optional password, assuming the preHost consists of
"username:password". | nsIURI | ||
| path : DOMString
The path, typically including at least a leading '/' (but may also
be empty, depending on the protocol). | nsIURI | ||
| port : Number
The URI's port. | nsIURI | ||
| prePath : DOMString [read-only]
The prePath returns the string before the path (such as
"scheme://user:password | nsIURI | ||
| scheme : DOMString
The scheme is the protocol to which this URI refers. | nsIURI | ||
| spec : DOMString
Returns a string representation of the URI. | nsIURI | ||
| username : DOMString
The optional username, assuming the preHost consists of
"username:password". | nsIURI | ||
| userPass : DOMString
The "username:password" (or username only if the value doesn't
contain a ':'). | nsIURI | ||
| Method | Defined By | ||
|---|---|---|---|
Clones the URI, returning a new nsIURI object. | nsIURI | ||
Compares the current URI with another URI, returning true if the two
represent the same location. | nsIURI | ||
Resolves a relative URI string, using this URI as the base. | nsIURI | ||
Quickly reports whether the nsIURI represents a URI with the specified
scheme. | nsIURI | ||
| asciiHost | property |
asciiHost:DOMString [read-only] The URI host with an ASCII compatible encoding. Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing Internet infrasture.
public function get asciiHost():DOMString| asciiSpec | property |
asciiSpec:DOMString [read-only] The URI spec with an ASCII compatible encoding. The host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.
public function get asciiSpec():DOMString| host | property |
host:DOMStringThe host is the Internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. If supported, it could be a non-ASCII internationalized domain name. Note: Characters are not escaped.
public function get host():DOMString public function set host(value:DOMString):void| hostPort | property |
hostPort:DOMStringThe "host : port" part of the URI (or simply the host, if port is -1). Note: Characters are not escaped.
public function get hostPort():DOMString public function set hostPort(value:DOMString):void| originCharset | property |
originCharset:DOMString [read-only] The charset of the document from which this URI originated. An empty value implies UTF-8. If this value is something other than UTF-8 then the URI components (e.g., spec, prePath, username, etc.) are all fully URL-escaped. Otherwise, the URI components may contain unescaped multibyte UTF-8 characters.
public function get originCharset():DOMString| password | property |
password:DOMStringThe optional password, assuming the preHost consists of "username:password". Note: Some characters may be escaped.
public function get password():DOMString public function set password(value:DOMString):void| path | property |
path:DOMStringThe path, typically including at least a leading '/' (but may also be empty, depending on the protocol). Note: Some characters may be escaped.
public function get path():DOMString public function set path(value:DOMString):void| port | property |
port:NumberThe URI's port. A port value of -1 corresponds to the protocol's default port (eg. -1 implies port 80 for HTTP URIs).
public function get port():Number public function set port(value:Number):void| prePath | property |
prePath:DOMString [read-only] The prePath returns the string before the path (such as "scheme://user:password
public function get prePath():DOMString| scheme | property |
scheme:DOMStringThe scheme is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per RFC2396.
public function get scheme():DOMString public function set scheme(value:DOMString):void| spec | property |
spec:DOMStringReturns a string representation of the URI. Setting the spec causes the new spec to be parsed using the rules for the scheme the URI currently has. If the string cannot be parsed as a URI, NS_ERROR_MALFORMED_URI thrown. If the URI stores information from the nsIIOService interface's newURI() call that created it, other than just the parsed string, the behavior of this information when setting the spec attribute is undefined.
public function get spec():DOMString public function set spec(value:DOMString):void| username | property |
username:DOMStringThe optional username, assuming the preHost consists of "username:password". Note: Some characters may be escaped.
public function get username():DOMString public function set username(value:DOMString):void| userPass | property |
userPass:DOMStringThe "username:password" (or username only if the value doesn't contain a ':'). Note: Some characters may be escaped.
public function get userPass():DOMString public function set userPass(value:DOMString):void| clone | () | method |
public function clone():nsIURIClones the URI, returning a new nsIURI object.
ReturnsnsIURI — An nsIURI object that represents the same URI as the current
nsIURI.
|
| equals | () | method |
public function equals(other:DOMString):BooleanCompares the current URI with another URI, returning true if the two represent the same location. Note: This is more than a string comparison, as two different URI strings can represent the same location. For example, comparing "http://foo.com:80/" and "http://foo.com/" will return true.
Parameters
other:DOMString — Another nsIURI to compare to.
|
Boolean — If the two URIs represent the same location
|
| resolve | () | method |
public function resolve(relativePath:DOMString):DOMStringResolves a relative URI string, using this URI as the base.
Parameters
relativePath:DOMString — The relative path to resolve.
|
DOMString — The resolved absolute URI string.
|
| schemeIs | () | method |
public function schemeIs(scheme:DOMString):BooleanQuickly reports whether the nsIURI represents a URI with the specified scheme. This comparison is case-insensitive. Note: This is an optimization, allowing you to check the scheme of the URI without having to get the scheme and do the comparison yourself; this saves memory allocations.
Parameters
scheme:DOMString — A string representing the scheme to compare to.
|
Boolean — If the URI is for the specified scheme
|