Answer the question
In order to leave comments, you need to log in
Redirect in ajax response?
How to redirect to a page from ajax response? The problem is that Ajax simply sends in response the page to which the redirect should be made, and does not make the transition itself.
I suspect you need to do something like
var address = ... // адрес полученный ajax-запросом
document.location.href = address;
Answer the question
In order to leave comments, you need to log in
More or less like this:
$.ajax({
url: 'https://jsonplaceholder.typicode.com/posts',
method: 'GET',
dataType: 'json',
success: function(posts) {
window.location.href = posts[0].title;
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question