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
我做了,謝謝你的建議。 –