Write JS function that sends the get request and updates the url?

Viewed 20

Right now i have ajax funciton that sends GET request successfully but it doesnt change the url and it does not refresh the page. Since i am writting a paginator in django, i would like a function to send url paremters to view, to refresh the page and get a new url with parameters shown. How can i write a similar function in js that is going to send the same GET request with parameters that are going to be shown in url: example:

www.localhost/page1/?date_start=01.01.2022&date_end=26.08.2022&type=1

my current function:

        function filterOrders(options) {
        $.ajax({
            type: "GET",
            url: '/orders/filter/',
            data: options,
            success: function (data) {
                ("#all_orders").html(data);
            }
        });
    }
0 Answers
Related