1
我到目前为止的代码,把我送到某个网页:
甜警报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";
}
);
出于某种原因,window.location.href是不工作,我试图只使用location.href和if(isConfirm)等。
我该怎么办?
的jsfiddle:https://jsfiddle.net/2dz868kd/
您应该将代码上传到[jsfiddle](https://jsfiddle.net/),以便用户可以看到演示并可以在其中进行更改。 – Webinion
我做了,谢谢你的建议。 –