【发布时间】:2017-04-25 17:05:20
【问题描述】:
到目前为止我的代码:
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";
}
);
由于某种原因,window.location.href 无法正常工作,我尝试仅使用 location.href 和 if(isConfirm) 等。
我该怎么办?
JSFiddle:https://jsfiddle.net/2dz868kd/
【问题讨论】:
-
您应该将代码上传到jsfiddle,以便用户可以看到演示并在那里进行更改。
-
我做到了,谢谢你的建议。
标签: javascript jquery html sweetalert sweetalert2