簡體   English   中英

如何使用JavaScript顯示一致消息對話框

[英]How to show conform message dialog box using javascript

我在此開發了一個小型的asp.net Web應用程序,在此按鈕中有一個,我正在使用onclick事件將頁面重定向到另一個頁面

  <a class="details-link" data-role="listview-link" onclick="AfterChangestatus('<%=Getstatus[0] %>')"><%=Getstatus[1] %></a>

        function AfterChangestatus(DocStatusvalues) {

        $("#place_of_loading_image").show();
        window.location.href = "AppointmentDetails.aspx?changedropdown=" + DocStatusvalues;

    }

這為我工作。

現在我想在相同的href中添加一致消息框,並帶有“是/否”按鈕,當我單擊“是”時,它將重定向到該頁面,否則它將保留在該頁面上並關閉彈出窗口

有可能請幫助我..

if(window.confirm("Are you sure?")){
    // do stuff
}else{
    // not confirmed stuff
}

嘗試這個:

function AfterChangestatus(DocStatusvalues) {
    var r = confirm("Are you sure?");

    if (r == true)
    {
        $("#place_of_loading_image").show();
        window.location.href = "AppointmentDetails.aspx?changedropdown=" + DocStatusvalues;
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM