0

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);
            }
        });
    }
kims9
  • 45
  • 1
  • 4
  • Why not just redirect the page? Why do you need to use ajax for that? – asportnoy Sep 23 '22 at 23:23
  • yes, i want to do it without ajax. I just added function as an example of what it is now. I want to have same functionality (same parameters, same url), but without ajax. – kims9 Sep 23 '22 at 23:24

0 Answers0