getXyz/setXyz methods return the decoded part
-- sogoog.Uri.parse('/foo%20bar').getPath() will return the
decoded path, /foo bar.
The constructor accepts an optional unparsed, raw URI string. The parser
is relaxed, so special characters that aren't escaped but don't cause
ambiguities will not cause parse failures.
All setters return this and so may be chained, a la
goog.Uri.parse('/foo').setFragment('part').toString().
| goog.Uri |
|
opt_uri
: *
Optional string URI to parse (use goog.Uri.create() to create a URI from parts), or if a goog.Uri is passed, a clone is created.
|
|
opt_ignoreCase
:
If true, #getParameterValue will ignore the case of the parameter name.
|
|
Clones the URI instance.
Returns:
New instance of the URI objcet.
|
code » | |||
enforceReadOnly()
Checks if this Uri has been marked as read only, and if so, throws an error.
This should be called whenever any modifying function is called.
|
code » | |||
|
No description.
Returns:
The decoded URI query, not including the ?.
|
code » | |||
|
No description.
Returns:
The decoded domain.
|
code » | |||
|
No description.
Returns:
The encoded URI query, not including the ?.
|
code » | |||
|
No description.
Returns:
The URI fragment, not including the #.
|
code » | |||
|
No description.
Returns:
Whether to ignore case.
|
code » | |||
getParameterValue(paramName)
⇒ *
Returns the first value for a given cgi parameter or undefined if the given
parameter name does not appear in the query string.
Arguments:
Returns:
*
The first value for a given cgi parameter or undefined if the given parameter name does not appear in the query string.
|
code » | |||
|
Returns the values for a given cgi parameter as a list of decoded
query parameter values.
|
code » | |||
|
No description.
Returns:
The decoded path.
|
code » | |||
|
No description.
Returns:
The port number.
|
code » | |||
|
No description.
Returns:
The encoded URI query, not including the ?. Warning: This method, unlike other getter methods, returns encoded value, instead of decoded one.
|
code » | |||
|
Returns the query data.
Returns:
QueryData object.
|
code » | |||
|
No description.
Returns:
The encoded scheme/protocol for the URI.
|
code » | |||
|
No description.
Returns:
The decoded user info.
|
code » | |||
|
No description.
Returns:
Whether the domain has been set.
|
code » | |||
|
No description.
Returns:
Whether the URI has a fragment set.
|
code » | |||
|
No description.
Returns:
Whether the path has been set.
|
code » | |||
|
No description.
Returns:
Whether the port has been set.
|
code » | |||
|
No description.
Returns:
Whether the query string has been set.
|
code » | |||
|
Returns true if this has the same domain as that of uri2.
|
code » | |||
|
No description.
Returns:
Whether the scheme has been set.
|
code » | |||
|
No description.
Returns:
Whether the user info has been set.
|
code » | |||
|
No description.
Returns:
Whether the URI is read only.
|
code » | |||
|
Adds a random parameter to the Uri.
Returns:
Reference to this Uri object.
|
code » | |||
|
Removes the named query parameter.
|
code » | |||
|
Resolves a relative url string to a this base uri.
There are several kinds of relative urls:
1. foo - replaces the last part of the path, the whole query and fragment 2. /foo - replaces the the path, the query and fragment 3. //foo - replaces everything from the domain on. foo is a domain name 4. ?foo - replace the query and fragment 5. #foo - replace the fragment only Additionally, if relative url has a non-empty path, all ".." and "." segments will be resolved, as described in RFC 3986. |
code » | |||
|
Sets the domain.
|
code » | |||
|
Sets the URI fragment.
|
code » | |||
|
Sets whether to ignore case.
NOTE: If there are already key/value pairs in the QueryData, and
ignoreCase_ is set to false, the keys will all be lower-cased.
|
code » | |||
|
Sets the value of the named query parameters, clearing previous values for
that key.
|
code » | |||
|
Sets the values of the named query parameters, clearing previous values for
that key. Not new values will currently be moved to the end of the query
string.
So,
goog.Uri.parse('foo?a=b&c=d&e=f').setParameterValues('c', ['new'])
yields foo?a=b&e=f&c=new.
|
code » | |||
|
Sets the path.
|
code » | |||
|
Sets the port number.
Arguments:
Returns:
Reference to this URI object.
|
code » | |||
|
Sets the URI query.
|
code » | |||
|
Sets the query data.
Arguments:
Returns:
Reference to this URI object.
|
code » | |||
|
Sets whether Uri is read only. If this goog.Uri is read-only,
enforceReadOnly_ will be called at the start of any function that may modify
this Uri.
|
code » | |||
|
Sets the scheme/protocol.
|
code » | |||
|
Sets the userInfo.
|
code » | |||
|
No description.
Returns:
The string form of the url.
|
code » |
|
Domain part, e.g. "www.google.com".
|
Code » | |
|
The fragment without the #.
|
Code » | |
|
Whether or not to ignore case when comparing query params.
|
Code » | |
|
Whether or not this Uri should be treated as Read Only.
|
Code » | |
|
Path, e.g. "/tests/img.png".
|
Code » | |
|
Port, e.g. 8080.
|
Code » | |
|
Object representing query data.
|
Code » | |
|
Scheme such as "http".
|
Code » | |
|
User credentials in the form "username:password".
|
Code » |
goog.Uri.create(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_query, opt_fragment, opt_ignoreCase)
⇒
Creates a new goog.Uri object from unencoded parts.
Arguments:
Returns:
The new URI object.
|
code » | |||||||||
|
Decodes a value or returns the empty string if it isn't defined or empty.
|
code » | |||||||||
|
Converts a character in [\01-\177] to its unicode character equivalent.
|
code » | |||||||||
|
If unescapedPart is non null, then escapes any characters in it that aren't
valid characters in a url and also escapes any special characters that
appear in extra.
|
code » | |||||||||
|
URI encode a string, or return null if it's not a string.
Arguments:
Returns:
Escaped string.
|
code » | |||||||||
|
Checks whether two URIs have the same domain.
|
code » | |||||||||
|
Creates a uri from the string form. Basically an alias of new goog.Uri().
If a Uri object is passed to parse then it will return a clone of the object.
|
code » | |||||||||
|
Removes dot segments in given path component, as described in
RFC 3986, section 5.2.4.
|
code » | |||||||||
|
Resolves a relative Uri against a base Uri, accepting both strings and
Uri objects.
Arguments:
Returns:
Resolved uri.
|
code » |
|
Parameter name added to stop caching.
|
Code » | |
|
Regular expression used for determining if a string needs to be encoded.
|
Code » | |
|
Regular expression for characters that are disallowed in an absolute path.
|
Code » | |
|
Regular expression for characters that are disallowed in the fragment.
|
Code » | |
|
Regular expression for characters that are disallowed in the query.
|
Code » | |
|
Regular expression for characters that are disallowed in a relative path.
|
Code » | |
|
Regular expression for characters that are disallowed in the scheme or
userInfo part of the URI.
|
Code » |