A
A
Anastasia2021-06-16 14:06:36
JavaScript
Anastasia, 2021-06-16 14:06:36

How to parse the Cyrillic get address bar and fill in the form with these conditions?

I have this address:

http://localhost/adm/?filtr={"status":["В%20обработке","Принят"],"sort":"_created","countent":"0"}

I'm trying to get this json from it, but for such a request:
strGET = window.location.search.replace( '?filtr=', '');

I get krakozyabry:
"{%22status%22:[%22%D0%92%20%D0%BE%D0%B1%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B5%22,%22%D0%9F%D1%80%D0%B8%D0%BD%D1%8F%D1%82%22],%22sort%22:%22_created%22,%22countent%22:%220%22}"


Of course, I can't parse it.

My main task is
1. in the form with id="filtr" checkboxes, whose value is equal to the values ​​from the JSON status address bar, issue the checked attribute
2. set the value in the select with id="sortfilt" value from the address bar under the key sort

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2021-06-16
@nastya97core

decodeURI

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question