Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseURI option #1140

Closed
bluelovers opened this issue Feb 7, 2018 · 3 comments · Fixed by #2510
Closed

baseURI option #1140

bluelovers opened this issue Feb 7, 2018 · 3 comments · Fixed by #2510

Comments

@bluelovers
Copy link

a.attr('href') return att href

but a.prop('href') should can return full url when baseURI is set

@starzou
Copy link

starzou commented Jul 15, 2018

+1

@starzou
Copy link

starzou commented Jul 15, 2018

I found a way, hope it can help you.

const url = require('url');
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'

@bluelovers
Copy link
Author

@starzou #1141

@fb55 fb55 changed the title hope can have baseURI option baseURI option Dec 22, 2020
fb55 added a commit that referenced this issue May 1, 2022
If `baseURI` is defined, `.prop('src')` and `.prop('href')` will resolve URLs. Only works if the global `URL` object is available.

Fixes #1140
@fb55 fb55 closed this as completed in #2510 May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants