페이지의 주요 내용을로드하는 데 아약스를 사용하는 웹 앱이 있습니다. 아약스와 탐색을 처리하는 jquery 주소를 사용하고 있습니다. 모달과 성공적인 제출에 나타나는 양식이 있습니다. 사용자를 새 페이지로 리디렉션하고 싶습니다. 모달 완전히 페이지 리디렉션은 블랙과 액세스 할 수 일으키는 일이 발생 숨겨져 전에부트 스트랩 모달 및 Jquery 주소 아약스 리디렉션 타이밍 문제
//called when form is submitted
$('#modal-form').on('submit', 'form', function (e) {
e.preventDefault();
var url = $(this).attr('action');
var data = $(this).serialize();
var method = $(this).attr('method');
$.ajax({
url: url,
data: data,
dataType: 'html',
method: method
}).fail(function (xhr, status, err) {
// Check for 401 unauthorized
if (xhr.status === 401) window.location = '/auth/login/';
}).done(function (data, status, xhr) {
$('#modal-form').modal('hide'); //Hide the modal
redirect(xhr); //Redirect to a new page
});
});
이제 문제가 : 여기에 코드입니다. 리디렉션 호출을 완전한 함수로 옮겨 보았지만 작동하지 않는 것 같습니다. 다른 정보가 필요하면 알려주십시오. 모달이 완료된 후
가능한 중복 : http://stackoverflow.com/questions/19676392/call-back-function-in-modal- of-bootstrap3 –