You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
47 KiB
63 lines
47 KiB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.Uri</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.Uri</h1><a class="source" href="source/lib/goog/uri/uri.js.src.html#l66">code »</a></header><section><p>This class contains setters and getters for the parts of the URI.
|
|
The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part
|
|
-- so<code>goog.Uri.parse('/foo%20bar').getPath()</code> will return the
|
|
decoded path, <code>/foo bar</code>.
|
|
|
|
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 <code>this</code> and so may be chained, a la
|
|
<code>goog.Uri.parse('/foo').setFragment('part').toString()</code>.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.Uri <span class="args">( opt_uri, opt_ignoreCase )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_uri: <code class="type">*=</code><dd>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.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true, #getParameterValue will ignore
|
|
the case of the parameter name.</dl></table></div></div></div></section><section><h2>Classes</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a><dd>Class used to represent URI query parameters.</dl></table></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l344">code »</a><span class="member"><a name="clone">clone</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Clones the URI instance.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>New instance of the URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l755">code »</a><span class="member"><a name="enforceReadOnly">enforceReadOnly</a> <span class="args">( )</span></span></div><p>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.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l567">code »</a><span class="member"><a name="getDecodedQuery">getDecodedQuery</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The decoded URI query, not including the ?.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l417">code »</a><span class="member"><a name="getDomain">getDomain</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The decoded domain.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l559">code »</a><span class="member"><a name="getEncodedQuery">getEncodedQuery</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The encoded URI query, not including the ?.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l665">code »</a><span class="member"><a name="getFragment">getFragment</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The URI fragment, not including the #.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l781">code »</a><span class="member"><a name="getIgnoreCase">getIgnoreCase</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether to ignore case.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l654">code »</a><span class="member"><a name="getParameterValue">getParameterValue</a> <span class="args">( paramName )</span> ⇒ <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code></span></div><p>Returns the first value for a given cgi parameter or undefined if the given
|
|
parameter name does not appear in the query string.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>paramName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Unescaped parameter name.</dl><tr><th>Returns<tr><td><dl>The first value for a given cgi parameter or
|
|
undefined if the given parameter name does not appear in the query
|
|
string.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l641">code »</a><span class="member"><a name="getParameterValues">getParameterValues</a> <span class="args">( name )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Returns the value<b>s</b> for a given cgi parameter as a list of decoded
|
|
query parameter values.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>name: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The parameter to get values for.</dl><tr><th>Returns<tr><td><dl>The values for a given cgi parameter as a list of
|
|
decoded query parameter values.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l484">code »</a><span class="member"><a name="getPath">getPath</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The decoded path.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l446">code »</a><span class="member"><a name="getPort">getPort</a> <span class="args">( )</span> ⇒ <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The port number.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l587">code »</a><span class="member"><a name="getQuery">getQuery</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The encoded URI query, not including the ?.
|
|
|
|
Warning: This method, unlike other getter methods, returns encoded
|
|
value, instead of decoded one.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l576">code »</a><span class="member"><a name="getQueryData">getQueryData</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Returns the query data.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>QueryData object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l352">code »</a><span class="member"><a name="getScheme">getScheme</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The encoded scheme/protocol for the URI.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l387">code »</a><span class="member"><a name="getUserInfo">getUserInfo</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The decoded user info.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l438">code »</a><span class="member"><a name="hasDomain">hasDomain</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the domain has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l687">code »</a><span class="member"><a name="hasFragment">hasFragment</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the URI has a fragment set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l505">code »</a><span class="member"><a name="hasPath">hasPath</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the path has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l476">code »</a><span class="member"><a name="hasPort">hasPort</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the port has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l513">code »</a><span class="member"><a name="hasQuery">hasQuery</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the query string has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l697">code »</a><span class="member"><a name="hasSameDomainAs">hasSameDomainAs</a> <span class="args">( uri2 )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Returns true if this has the same domain as that of uri2.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>uri2: <code class="type"><a href="class_goog_Uri.html">goog.Uri</a></code><dd>The URI object to compare to.</dl><tr><th>Returns<tr><td><dl>true if same domain; false otherwise.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l379">code »</a><span class="member"><a name="hasScheme">hasScheme</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the scheme has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l409">code »</a><span class="member"><a name="hasUserInfo">hasUserInfo</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the user info has been set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l746">code »</a><span class="member"><a name="isReadOnly">isReadOnly</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the URI is read only.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l709">code »</a><span class="member"><a name="makeUnique">makeUnique</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Adds a random parameter to the Uri.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Reference to this Uri object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l723">code »</a><span class="member"><a name="removeParameter">removeParameter</a> <span class="args">( key )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Removes the named query parameter.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The parameter to remove.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l269">code »</a><span class="member"><a name="resolve">resolve</a> <span class="args">( relativeUri )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Resolves the given relative URI (a goog.Uri object), using the URI
|
|
represented by this instance as the base URI.
|
|
|
|
There are several kinds of relative URIs:<br>
|
|
1. foo - replaces the last part of the path, the whole query and fragment<br>
|
|
2. /foo - replaces the the path, the query and fragment<br>
|
|
3. //foo - replaces everything from the domain on. foo is a domain name<br>
|
|
4. ?foo - replace the query and fragment<br>
|
|
5. #foo - replace the fragment only
|
|
|
|
Additionally, if relative URI has a non-empty path, all ".." and "."
|
|
segments will be resolved, as described in RFC 3986.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>relativeUri: <code class="type"><a href="class_goog_Uri.html">goog.Uri</a></code><dd>The relative URI to resolve.</dl><tr><th>Returns<tr><td><dl>The resolved URI.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l428">code »</a><span class="member"><a name="setDomain">setDomain</a> <span class="args">( newDomain, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the domain.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newDomain: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New domain value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l676">code »</a><span class="member"><a name="setFragment">setFragment</a> <span class="args">( newFragment, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the URI fragment.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newFragment: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New fragment value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l769">code »</a><span class="member"><a name="setIgnoreCase">setIgnoreCase</a> <span class="args">( ignoreCase )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>whether this goog.Uri should ignore case.</dl><tr><th>Returns<tr><td><dl>Reference to this Uri object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l600">code »</a><span class="member"><a name="setParameterValue">setParameterValue</a> <span class="args">( key, value )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the value of the named query parameters, clearing previous values for
|
|
that key.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The parameter to set.<dt>value: <code class="type">*</code><dd>The new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l620">code »</a><span class="member"><a name="setParameterValues">setParameterValues</a> <span class="args">( key, values )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>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, <code>goog.Uri.parse('foo?a=b&c=d&e=f').setParameterValues('c', ['new'])
|
|
</code> yields <tt>foo?a=b&e=f&c=new</tt>.</p></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The parameter to set.<dt>values: <code class="type">*</code><dd>The new values. If values is a single
|
|
string then it will be treated as the sole value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l495">code »</a><span class="member"><a name="setPath">setPath</a> <span class="args">( newPath, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the path.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newPath: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New path value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l456">code »</a><span class="member"><a name="setPort">setPort</a> <span class="args">( newPort )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the port number.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newPort: <code class="type">*</code><dd>Port number. Will be explicitly casted to a number.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l551">code »</a><span class="member"><a name="setQuery">setQuery</a> <span class="args">( newQuery, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the URI query.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newQuery: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New query value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l525">code »</a><span class="member"><a name="setQueryData">setQueryData</a> <span class="args">( queryData, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the query data.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>queryData: <code class="type">(<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code><dd>QueryData object.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.
|
|
Applies only if queryData is a string.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l737">code »</a><span class="member"><a name="setReadOnly">setReadOnly</a> <span class="args">( isReadOnly )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>isReadOnly: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>whether this goog.Uri should be read only.</dl><tr><th>Returns<tr><td><dl>Reference to this Uri object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l363">code »</a><span class="member"><a name="setScheme">setScheme</a> <span class="args">( newScheme, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the scheme/protocol.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newScheme: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New scheme value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l398">code »</a><span class="member"><a name="setUserInfo">setUserInfo</a> <span class="args">( newUserInfo, opt_decode )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Sets the userInfo.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>newUserInfo: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>New userInfo value.<dt>opt_decode: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Optional param for whether to decode new value.</dl><tr><th>Returns<tr><td><dl>Reference to this URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l199">code »</a><span class="member"><a name="toString">toString</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The string form of the url.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l144">code »</a><span class="member"><a name="domain_">domain_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Domain part, e.g. "www.google.com".</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l176">code »</a><span class="member"><a name="fragment_">fragment_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>The fragment without the #.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l192">code »</a><span class="member"><a name="ignoreCase_">ignoreCase_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether or not to ignore case when comparing query params.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l184">code »</a><span class="member"><a name="isReadOnly_">isReadOnly_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether or not this Uri should be treated as Read Only.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l160">code »</a><span class="member"><a name="path_">path_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Path, e.g. "/tests/img.png".</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l152">code »</a><span class="member"><a name="port_">port_</a> : <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Port, e.g. 8080.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l168">code »</a><span class="member"><a name="queryData_">queryData_</a> : <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Object representing query data.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l128">code »</a><span class="member"><a name="scheme_">scheme_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Scheme such as "http".</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l136">code »</a><span class="member"><a name="userInfo_">userInfo_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>User credentials in the form "username:password".</summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l822">code »</a><span class="member"><a name="goog.Uri.create">goog.Uri.create</a> <span class="args">( opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_query, opt_fragment, opt_ignoreCase )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Creates a new goog.Uri object from unencoded parts.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_scheme: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>Scheme/protocol or full URI to parse.<dt>opt_userInfo: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>username:password.<dt>opt_domain: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>www.google.com.<dt>opt_port: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>9830.<dt>opt_path: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>/some/path/to/a/file.html.<dt>opt_query: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a>)=</code><dd>a=1&b=2.<dt>opt_fragment: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The fragment without the #.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether to ignore parameter name case in
|
|
#getParameterValue.</dl><tr><th>Returns<tr><td><dl>The new URI object.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l914">code »</a><span class="member"><a name="goog.Uri.decodeOrEmpty_">goog.Uri.decodeOrEmpty_</a> <span class="args">( val )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Decodes a value or returns the empty string if it isn't defined or empty.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>val: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code><dd>Value to decode.</dl><tr><th>Returns<tr><td><dl>Decoded value.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l944">code »</a><span class="member"><a name="goog.Uri.encodeChar_">goog.Uri.encodeChar_</a> <span class="args">( ch )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Converts a character in [\01-\177] to its unicode character equivalent.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>ch: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>One character string.</dl><tr><th>Returns<tr><td><dl>Encoded string.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l930">code »</a><span class="member"><a name="goog.Uri.encodeSpecialChars_">goog.Uri.encodeSpecialChars_</a> <span class="args">( unescapedPart, extra )</span> ⇒ <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>unescapedPart: <code class="type">*</code><dd>The string to encode.<dt>extra: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code><dd>A character set of characters in [\01-\177].</dl><tr><th>Returns<tr><td><dl>null iff unescapedPart == null.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l997">code »</a><span class="member"><a name="goog.Uri.haveSameDomain">goog.Uri.haveSameDomain</a> <span class="args">( uri1String, uri2String )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Checks whether two URIs have the same domain.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>uri1String: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>First URI string.<dt>uri2String: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Second URI string.</dl><tr><th>Returns<tr><td><dl>true if the two URIs have the same domain; false otherwise.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l801">code »</a><span class="member"><a name="goog.Uri.parse">goog.Uri.parse</a> <span class="args">( uri, opt_ignoreCase )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>uri: <code class="type">*</code><dd>Raw URI string or instance of Uri
|
|
object.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether to ignore the case of parameter
|
|
names in #getParameterValue.</dl><tr><th>Returns<tr><td><dl>The new URI object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l868">code »</a><span class="member"><a name="goog.Uri.removeDotSegments">goog.Uri.removeDotSegments</a> <span class="args">( path )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Removes dot segments in given path component, as described in
|
|
RFC 3986, section 5.2.4.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>path: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>A non-empty path component.</dl><tr><th>Returns<tr><td><dl>Path component with removed dot segments.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l848">code »</a><span class="member"><a name="goog.Uri.resolve">goog.Uri.resolve</a> <span class="args">( base, rel )</span> ⇒ <code class="type">!<a href="class_goog_Uri.html">goog.Uri</a></code></span></div><p>Resolves a relative Uri against a base Uri, accepting both strings and
|
|
Uri objects.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>base: <code class="type">*</code><dd>Base Uri.<dt>rel: <code class="type">*</code><dd>Relative Uri.</dl><tr><th>Returns<tr><td><dl>Resolved uri.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l120">code »</a><span class="member"><a name="goog.Uri.RANDOM_PARAM">goog.Uri.RANDOM_PARAM</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Parameter name added to stop caching.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l113">code »</a><span class="member"><a name="goog.Uri.preserveParameterTypesCompatibilityFlag">goog.Uri.preserveParameterTypesCompatibilityFlag</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>If true, we preserve the type of query parameters set programmatically.
|
|
|
|
This means that if you set a parameter to a boolean, and then call
|
|
getParameterValue, you will get a boolean back.
|
|
|
|
If false, we will coerce parameters to strings, just as they would
|
|
appear in real URIs.
|
|
|
|
TODO(nicksantos): Remove this once people have time to fix all tests.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l972">code »</a><span class="member"><a name="goog.Uri.reDisallowedInAbsolutePath_">goog.Uri.reDisallowedInAbsolutePath_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression for characters that are disallowed in an absolute path.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l988">code »</a><span class="member"><a name="goog.Uri.reDisallowedInFragment_">goog.Uri.reDisallowedInFragment_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression for characters that are disallowed in the fragment.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l980">code »</a><span class="member"><a name="goog.Uri.reDisallowedInQuery_">goog.Uri.reDisallowedInQuery_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression for characters that are disallowed in the query.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l964">code »</a><span class="member"><a name="goog.Uri.reDisallowedInRelativePath_">goog.Uri.reDisallowedInRelativePath_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression for characters that are disallowed in a relative path.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l956">code »</a><span class="member"><a name="goog.Uri.reDisallowedInSchemeOrUserInfo_">goog.Uri.reDisallowedInSchemeOrUserInfo_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression for characters that are disallowed in the scheme or
|
|
userInfo part of the URI.</summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script> |