Is the below a valid URL: https://www.example.com/news?check=check-if-a-javascript-string-is-a-url/after-check
If not, what if I want to add some new path after a query string? For example "after-check" here
I've also tried putting a hash after query string to terminate but shall after-check consider as a new pathname? https://www.example.com/news?check=check-if-a-javascript-string-is-a-url#/after-check
This is a VALID URL: https://www.example.com/news?check=check-if-a-javascript-string-is-a-url/after-check.
The path is /news, and query parameters is
{
"check": "check-if-a-javascript-string-is-a-url/after-check"
}
So I guess this is not the result you want.
The second URL https://www.example.com/news?check=check-if-a-javascript-string-is-a-url#/after-check is also a valid URL.
The path is news and query parameters is {"check": "check-if-a-javascript-string-is-a-url"}. And the part #/after-check is HASH but not path.