Skip to content

Commit

Permalink
adding docs for .resource()
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Oct 30, 2012
1 parent f0c28fa commit 01cfbc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions about-uris.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ <h3>Components of an <abbr title="Uniform Resource Locator">URL</abbr> in URI.js
<a href="docs.html#accessors-authority">authority</a>
<span class="line"> __________|_________
/ \
</span> <a href="docs.html#accessors-userinfo">userinfo</a> <a href="docs.html#accessors-host">host</a>
<span class="line"> __|___ ___|___
/ \ / \
</span> <a href="docs.html#accessors-userinfo">userinfo</a> <a href="docs.html#accessors-host">host</a> <a href="docs.html#accessors-resource">resource</a>
<span class="line"> __|___ ___|___ __________|___________
/ \ / \ / \
</span> <a href="docs.html#accessors-username">username</a> <a href="docs.html#accessors-password">password</a> <a href="docs.html#accessors-hostname">hostname</a> <a href="docs.html#accessors-port">port</a> <a href="docs.html#accessors-pathname">path</a> &amp; <a href="docs.html#accessors-segment">segment</a> <a href="docs.html#accessors-search">query</a> <a href="docs.html#accessors-hash">fragment</a>
<span class="line"> __|___ __|__ ______|______ | __________|_________ ____|____ |
/ \ / \ / \ / \ / \ / \ / \
Expand Down
11 changes: 10 additions & 1 deletion docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1><a href="https://github.com/medialize/URI.js">URI.js</a></h1>

<li><a href="#accessors-search">search(), query()</a></li>
<li><a href="#accessors-hash">hash(), fragment()</a></li>

<li><a href="#accessors-resource">resource()</a></li>
<li><a href="#is">determine URL types</a></li>
</ul>
</li>
Expand Down Expand Up @@ -458,6 +458,15 @@ <h3 id="accessors-hash">hash(), fragment()</h3>
uri.hash("mars"); // returns the URI instance for chaining
// uri == "http://example.org/bar/world.xml#mars"</pre>

<h3 id="accessors-resource">resource()</h3>
<p>Resource is comprised of path, query and fragment</p>
<pre class="prettyprint lang-js">var uri = new URI("http://example.org/foo/hello.html?query=string#hash");
// get resource
uri.resource(); // returns string "/foo/hello.html?query=string#hash"
// set resource
uri.resource("/mars.txt?query=foo#other"); // returns the URI instance for chaining</pre>
<p>NOTE: .resource() will reset any of path, query and fragment if they're not specified.</p>

<h3 id="is">is()</h3>
<p>.is() tells what a URL is. It responds with a boolean and can be asked the following questions:</p>
<dl>
Expand Down

0 comments on commit 01cfbc6

Please sign in to comment.