Shayvard Shayvard - 10 months ago 57
Ajax Question

How do I use Sweet Alert Messages in Laravel 5.2 by Ajax?

I want after the user clicked, Without refresh page, add this product in the basket of goods then show Sweet Alert Messages for the user.

Answer Source

You simply need to create on click function and then call ajax request with done or success function.


$('.element').on('click', function() {
       url: url,
       data: {
    .done(function() {
       //other stuff

Hope it helps.