我有一個確認框,用戶可以在其中選擇確定繼續或取消關閉框並保持在同一頁面上。問題是,除了Opera,如果我點擊確認框中的取消,那麼所有瀏覽器都會關閉,並且用戶停留在同一頁面上,這很好,但是在Opera中,如果點擊取消,它也會關閉頁面。如果我在確認框上按取消,它會關閉我不想要發生的頁面
我需要包括什麼,才能在Opera中單擊確認框中的取消,它會關閉框但不關閉頁面?
下面是代碼:
function showConfirm(){
var confirmMsg=confirm("Make sure that your details are correct, once you proceed after this stage you would not be able to go back and change any details towards your Session." + "\n" + "\n" + "Are you sure you want to Proceed?" + "\n");
if (confirmMsg==true)
{
submitform();
}else{
parent.close();
}
}
由於
如果你擺脫了parent.close會發生什麼?我不認爲你想那樣。 – TommyBs