websanova / js-url

url() - A simple, lightweight url parser for JavaScript
http://www.websanova.com
MIT License
1.93k stars 204 forks source link

Seems like url('domain' .. always return undefined #47

Closed linuxenko closed 8 years ago

websanova commented 8 years ago

Try hostname. On Mar 27, 2016 20:50, "Svetlana Linuxenko" notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/websanova/js-url/issues/47

linuxenko commented 8 years ago

'hostname' work just fine. i though 'domain' will return hostname without 'www' or any other top level things . ok , it's difficult stuff , i understand .

websanova commented 8 years ago

You only get domains if you use the tld version. Otherwise it will return undefined.

https://github.com/websanova/js-url/blob/master/url.js#L163

On Sun, Mar 27, 2016 at 10:54 PM, Svetlana Linuxenko < notifications@github.com> wrote:

'hostname' work just fine. i though 'domain' will return hostname without 'www' or any other top level things . ok , it's difficult stuff , i understand .

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/websanova/js-url/issues/47#issuecomment-202095198