Answers for "how to parse url string"

1

string to url javascript

encodeURI(string);
Posted by: Guest on July-12-2021
0

parse data from url javascript

//   https://www.example.com?name=n1&name=n2
let params = new URLSearchParams(location.search);
params.get('name') //    => "n1"
params.getAll('name') //    => ["n1", "n2"]
// SOURCE : https://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript
// REPLY : Franklin Yu
Posted by: Guest on April-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language