marcosesperon / Messi

A simple message plugin for jQuery
http://marcosesperon.es/apps/messi/
146 stars 139 forks source link

redirect user to a new window after showing Messi alert #41

Closed satyadoorva closed 10 years ago

satyadoorva commented 10 years ago

Hi,

I am trying to redirect the user to a new page after showing Messi alert.

$.ajax({ type: "POST", url: "scorecalc.php", data: {"w":JSON.stringify(sessionStorage)}, cache:false, success: function(result) {

                    a = new Messi(result, {title: 'Result',titleClass: 'info',buttons: [{id: 0, label: 'Close', val: 'X'}]});
                  window.location='test_dashboard.php';

              }
    });

The alert doesn't waits to be closed manually before redirecting it to the page.

If I remove the redirect line, alert waits for user interaction.

$.ajax({ type: "POST", url: "scorecalc.php", data: {"w":JSON.stringify(sessionStorage)}, cache:false, success: function(result) {

                    a = new Messi(result, {title: 'Result',titleClass: 'info',buttons: [{id: 0, label: 'Close', val: 'X'}]});

// window.location='test_dashboard.php';

              }
    });

I want the alert to wait, how should it happen ?

satyadoorva commented 10 years ago

Solved the issue by using Messi.ask() . Works like a charm!!