开发者

Apprise is a great plugin, but with a little problem. What to change?

开发者 https://www.devze.com 2023-03-01 05:27 出处:网络
Here is this great plugin: http://thrivingkings.com/apprise/ When I use apprise(\'Hello\'); or other function it doesn\'t stop, it continues to execute jQuery code while simple alert(开发者_开发百科\

Here is this great plugin: http://thrivingkings.com/apprise/

When I use apprise('Hello'); or other function it doesn't stop, it continues to execute jQuery code while simple alert(开发者_开发百科"hello"); would stop executing js code. So, any ideas how to solve this?

I really want to use it, because it is extremely cool and light-weighted. (Or maybe you know any other plugins for alert messages as awesome as this one?).

Thanks.


It looks like it's meant to be non-blocking. In other words, if you want your subsequent code to wait until the apprise box has closed, you'll have to pass in a continuation:

apprise('Hello', null, function() { /* continuation */ });

Edit:

Further clarification:

$(document).ready(function(){
    apprise('Hello', null, function(){
        // the code here will execute after the msg box has been closed
    });
    // this code will execute immediately, not waiting for the box to close
});

This is as designed in a non-blocking call. Any code that you want to have execute after the box has been close must be contained in the continuation.

0

精彩评论

暂无评论...
验证码 换一张
取 消