projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6a1659
)
doc: add url.resolve() usage examples
author
Ben Noordhuis
<info@bnoordhuis.nl>
Mon, 4 Mar 2013 19:54:34 +0000
(20:54 +0100)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Mon, 4 Mar 2013 19:54:36 +0000
(20:54 +0100)
Fixes #4913.
doc/api/url.markdown
patch
|
blob
|
history
diff --git
a/doc/api/url.markdown
b/doc/api/url.markdown
index 8e6a63d3bbceb2e5f3f920695580a1a35bd20a92..7b5f69c20b20ad53912247ded6ef9465b2f59787 100644
(file)
--- a/
doc/api/url.markdown
+++ b/
doc/api/url.markdown
@@
-96,4
+96,8
@@
Take a parsed URL object, and return a formatted URL string.
## url.resolve(from, to)
Take a base URL, and a href URL, and resolve them as a browser would for
-an anchor tag.
+an anchor tag. Examples:
+
+ url.resolve('/one/two/three', 'four') // '/one/two/four'
+ url.resolve('http://example.com/', '/one') // 'http://example.com/one'
+ url.resolve('http://example.com/one', '/two') // 'http://example.com/two'