D
D
DarkByte20152017-09-08 20:39:10
Django
DarkByte2015, 2017-09-08 20:39:10

How to make a POST request with a transition to the desired view?

There is one view, on it is a button on click on which I have to switch from to another view. Everything seems to be simple, but there (in the second view) you need to transfer data (without forms) and there is quite a lot of data to send them with a GET request, so I'm trying to send a POST request. But the POST request that I make with ajax through jquery only returns the generated page, and I need to redirect to this page ... I just don’t understand how to do this.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pretor DH, 2017-09-08
@DarkByte2015

Don't do it via AJAX.
NOT?
If you really need it, create a temporary form from internal data and submit it with JS.
If it's a cart. In no case can you do it without a form. Then the SEO-shnik will not be able to screen the Goals in the AJAX form.

A
Astrohas, 2017-09-08
@Astrohas

perversion, some, but

success: function (data) {
           window.location.href = "http://stackoverflow.com";
        }

It won't work without forms.
Well you can create a hidden form and submit it

P
Pavel Kornilov, 2017-09-09
@KorniloFF

Well, as an experiment, you can do AJAX with the necessary data to a third-party page, and after the response, completely dynamically redraw the DOM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question