websanova / js-url

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

url.min.js BUG #38

Closed hgati closed 9 years ago

hgati commented 9 years ago

there is a bug on your url.min.js url('domain') not work (undefined) the url.js works but url.min.js not work.

websanova commented 9 years ago

Hey, which version are you using?

The latest seems ok for me.

Also is this just the test file already in there or some custom test and url?

hgati commented 9 years ago

that version is.. https://raw.githubusercontent.com/websanova/js-url/master/url.min.js

snap1

snap2

websanova commented 9 years ago

Can you post an example html file? On Sep 15, 2015 3:52 PM, "hgati" notifications@github.com wrote:

that version is.. https://raw.githubusercontent.com/websanova/js-url/master/url.min.js

— Reply to this email directly or view it on GitHub https://github.com/websanova/js-url/issues/38#issuecomment-140326867.

websanova commented 9 years ago

Are you still having issues with this in the new version?

hgati commented 9 years ago

https://raw.githubusercontent.com/websanova/js-url/master/url.min.js Yes, same to. still "undefined"

websanova commented 9 years ago

What happens if you run it like url('domain', 'http://amarket.co.kr'); Also can you check what window.location.toString() gives you please.

websanova commented 9 years ago

Hey, sorry, just realized. You need to use the url-tld version to get the domain. This is because it includes a list of tld names such as co.kr which is required to parse out what the correct domain, tld and sub domains are.

Use this one: https://raw.githubusercontent.com/websanova/js-url/master/url-tld.min.js

hgati commented 9 years ago

Great~ It works. thanks.