1

実際にはajaxを介してサーバーからデータを取得しているため、データを正常にフェッチした後、同じ画面/ URLにリダイレクトしています。リダイレクト後にdivを表示/表示する必要がありますか? jquery でこのようにすることは可能ですか?

$.ajax({
    type: "POST",
    url: action,
    data: form_data,
    success: function (response) {
        if (response.status == 'undone') {

            $('#paypal_email_error').html(response.errors.paypal_email);
            $('.er_msg').show();
        }
        if (response.status == 'done') {
            window.location = '/accounts/email/';
            $('.show_this').show();
        }

    }
    });
});

template.html

<div class="alert alert-error hide show_this">
    <li>Saved Email successfully </li>
</div>
4

1 に答える 1