Ox.parseURL: update docs & examples

This commit is contained in:
rolux 2012-06-03 11:12:21 +02:00
parent 9ce126263b
commit 42092f163b

View file

@ -169,25 +169,30 @@ Ox.parseSRT = function(string, fps) {
/*@
Ox.parseURL <f> Takes a URL, returns its components
(url) -> <o> URL components
hash <s> Hash
host <s> Host
hostname <s> Hostname
origin <s> Origin
pathname <s> Pathname
port <s> Port
protocol <s> Protocol
search <s> Search
url <s> URL
<script>
Ox.test.object = Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c');
</script>
> Ox.test.object.hash
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').hash
'#c'
> Ox.test.object.host
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').host
'www.foo.com:8080'
> Ox.test.object.hostname
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').hostname
'www.foo.com'
> Ox.test.object.origin
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').origin
'http://www.foo.com:8080'
> Ox.test.object.pathname
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').pathname
'/bar/index.html'
> Ox.test.object.port
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').port
'8080'
> Ox.test.object.protocol
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c')protocol
'http:'
> Ox.test.object.search
> Ox.parseURL('http://www.foo.com:8080/bar/index.html?a=0&b=1#c').search
'?a=0&b=1'
@*/
Ox.parseURL = (function() {