3

I am submitting the form by ajax. It's working properly but I have one issue with the success message.

After ajax success, I have to display success message like default Magento2. How can I achieve this?

$.ajax({
    url: "<?php echo $block->getUrl('frontname/order/save'); ?>",
    type: "POST",
    dataType: "text",
    data: "cancel= " + orderJSON,
    showLoader: true,
    success: function () {
    $("#" + id).remove();
    window.location.reload();
   }
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.