Is there any good way to prevent the parameters in the url from being cut when the median value of the address bar key pair is the new url?

question:

is there any good way to prevent the parameters in the url from being cut when the median value of the address bar key pair is the new url?

May.18,2022

you can achieve

with encodeURIComponent .
encodeURIComponent('https://xxx.com?a=b&b=c')

convert to

https%3A%2F%2Fxxx.com%3Fa%3Db%26b%3Dc

the transcoded string can be used as a URL parameter

https://xxx.com?c=https%3A%2F%2Fxxx.com%3Fa%3Db%26b%3Dc&d=123

after obtaining the parameters, you can use decodeURIComponent to decode

Menu