How does URL tell the difference & whether the following parameters belong to the address or to the parameters?

as the title
give an example
http://localhost:8081/admin/login?ref=http://localhost:8081/admin/article/list?page=2&size=2

to be exact, the address has only one parameter, and the value of ref is a url, so the question arises: does & size=2 belong to the previous address parameter or to the latter address parameter? Can the browser recognize it? Is it possible to encode the value of the parameter? To remove ambiguity

Apr.11,2021

you can encode the ref value encodeURIComponent method.

  

as you write, & size=2 is the parameter recognized by the browser as the preceding address. To prevent ambiguity, use encodeURIComponent to encode

the part that needs to be used as the parameter value.
Menu