Clever Way of Extract URL Information in JS
Here’s a nice little way to extract URL information from a string. Rather than
trying to parse/split the string into its parts (protocol, host, path, query)
just use an a
tag and access it’s properties to get the relative information
you want.
1 2 3 4 5 6 7 8 9 |
|
Simples.