I have a text like this'?category=1,2&brand=1'
how can I change this text into this
'?categories[]=1&categories[]=2&brands[]=1'
?
Asked
Active
Viewed 42 times
1

Ruslan Bairamovi
- 378
- 3
- 22
1 Answers
0
pass parameter like: ?category=[1,2]&brand=1
get using : JSON.parse();

qɐʇǝɥɐW
- 347
- 3
- 17
-
I guess I need string.split() but can not achive the result yet – Ruslan Bairamovi Nov 17 '20 at 12:03
-
https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript might help... ( find a better answer ).. happy coding... – qɐʇǝɥɐW Nov 17 '20 at 12:06
-
1did not help. Thanks anyway – Ruslan Bairamovi Nov 17 '20 at 12:24