从swal获取上下文

时间:2019-04-14 07:34:23

标签: javascript java html web

我刚刚学习网络编程,并且正在使用“甜蜜警报”。 我想从警报框中获取上下文。 我需要如何设置var来保存上下文。 这是我的代码:

function started_pop_up(){
    swal.fire({   
        title: "New Game",   
        text: "How much you wanna play???:",   
        input: 'text',   
        showCancelButton: true,   
        closeOnConfirm: false,   
        animation: "slide-from-top",   
        inputPlaceholder: "insert a number" ,
        closeOnClickOutside: false },
        function(inputValue)
        {   
            if (inputValue === false) 
            return false;      
               if (inputValue === "") {     
                swal.showInputError("Please enter a number!");     
                return false   
                }      
             swal("Action Saved!", "You entered following email: " + inputValue, "success"); 
        });

}

0 个答案:

没有答案
相关问题