1

I want to get the object from URL search params which formalized via $.param() method.

For example, i construct the URL like this when user filter a table column

  const filter = {filter: {name: 'John Doe', age: 40}};

  $(location).attr('search', $.param(filter));
  // URL localhost:3000/users?filter%5Bname%5D=John+Doe&filter%5Bage%5D=40

Then he gives the link his friend, he put it in browser and go to page.

The question is how can i get object from ?filter%5Bname%5D=John+Doe&filter%5Bage%5D=40 like {filter: {name: 'John Doe', age: 40}}

haacki47
  • 416
  • 1
  • 4
  • 15
  • To turn form-urlencoded values in to an object, see [this specific answer](https://stackoverflow.com/a/2880929/519413) of the duplicate – Rory McCrossan Aug 17 '19 at 18:09

0 Answers0