Can you wait for javascript callback?

前端 未结 9 1621
故里飘歌
故里飘歌 2020-11-29 22:21

I\'m trying to use the jQuery alerts dialog library from http://abeautifulsite.net/notebook/87 instead of the default alerts (which look pretty awful in my opinion). This se

9条回答
  •  情歌与酒
    2020-11-29 23:06

    I would assume you'd have to grab the response like this. I don't think you need a callback.

    function confirm() {
            var response = jConfirm('are you sure?', 'Confirmation Dialog');
            if (response) {
                alert(result);
            }
            else {
                //wait for response
                alert('hi');
            }
        }
    

提交回复
热议问题