I'm parsing a path string containing everything after the hostname, meaning the path, query, and fragment. Previously, I was calling this whole chunk the path
in a function parseUrlPath
, but that's a bit confusing, since I'm calling both the inner part and the whole thing the path
Maybe it's not the worst idea... I mean, we use the word "server" for both the machine itself and the program running on that machine. But does anyone have an idea? Or even better, a reference citing an existing name for the path/query/fragment?
URI.js calls the function path()
for getting/setting the path and resource()
for setting the part of the URI "comprising of path, query, and fragment."
Given the URI https://[email protected]:8080/foo/bar.html?q=3#baz
:
path() === '/foo/bar.html'
query() === 'q=3'
resource() === '/foo/bar.html?q=3#baz'
This might be useful: https://medialize.github.io/URI.js/docs.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With