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

前端 未结 6 1785
甜味超标
甜味超标 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:43

    In jQuery, you can use:

    let myObject = {first:1, second:12, third:5};
    jQuery.param(myObject);
    

    Doc: http://api.jquery.com/jquery.param/ The output: first=1&second=12&third=5 This will format it, whatever your object contain.

提交回复
热议问题