2 ms·
There is a new URL api but it's still "experimental" and not supported at all by IE. This new API is just a different interface to the url parsing logic already
by manigandham 10y ago
There is a new URL api but it's still "experimental" and not supported at all by IE. This new API is just a different interface to the url parsing logic already used for the location and href objects so you can use those instead and get the same functionality.
A tag elements expose this with the href attribute and it's very lightweight since it's not inserted into the DOM. Create one reusable global element and make a wrapper function around it if you want to be even more efficient.