How do I pass a URL with multiple parameters into a URL?

前端 未结 6 1779
甜味超标
甜味超标 2020-12-08 13:33

Basically I\'m trying to pass a URL like this:

www.foobar.com/?first=1&second=12&third=5

into a URL like this:

http         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-08 13:56

    In your example parts of your passed-in URL are not URL encoded (for example the colon should be %3A, the forward slashes should be %2F). It looks like you have encoded the parameters to your parameter URL, but not the parameter URL itself. Try encoding it as well. You can use encodeURIComponent.

提交回复
热议问题