小编Cal*_*oli的帖子

Sweet Alert 2 和 javascript:如何制作一个甜蜜警报按钮,点击后将我发送到某个网页

到目前为止我的代码:

swal({ 
    title: 'Successfully Registered!', 
    text: "Do you want to go to the Log In page?", 
    type: 'success', 
    showCancelButton: true, 
    confirmButtonColor: '#3085d6', 
    cancelButtonColor: '#d33', 
    confirmButtonText: 'Yes, send me there!' 
    }, 
    function(){ 
       window.location.href= "http://example.com"; 
    }
); 
Run Code Online (Sandbox Code Playgroud)

由于某种原因,window.location.href 不起作用,我尝试只使用location.href 和if(isConfirm) 等
。我该怎么办?
JSFiddle:https ://jsfiddle.net/2dz868kd/

html javascript jquery sweetalert sweetalert2

2
推荐指数
1
解决办法
5350
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1

sweetalert ×1

sweetalert2 ×1