Shayvard Shayvard - 3 years ago 235
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download