Converts a relative URL to an absolute URL.
Handles various URL formats:
/path
https://example.com/path
../path
//cdn.com/file
https://cdn.com/file
The base URL to resolve against
The relative or absolute path to convert
The absolute URL
convertToAbsoluteURL('https://example.com/page', '/images/pic.jpg')// Returns: 'https://example.com/images/pic.jpg'convertToAbsoluteURL('https://example.com/dir/', '../file.html')// Returns: 'https://example.com/file.html' Copy
convertToAbsoluteURL('https://example.com/page', '/images/pic.jpg')// Returns: 'https://example.com/images/pic.jpg'convertToAbsoluteURL('https://example.com/dir/', '../file.html')// Returns: 'https://example.com/file.html'
Converts a relative URL to an absolute URL.
Handles various URL formats:
/path→https://example.com/path../path→ resolves correctly//cdn.com/file→https://cdn.com/file