簡體   English   中英

在Ajax調用完成后而不是之前或期間彈出模式

[英]Modal pops up after Ajax call completes instead of before or during

我正在嘗試在進行Ajax調用時使模式彈出窗口顯示“ Please Wait”。 僅在呼叫完成后才會彈出。

當我單擊我的Web鏈接時,一切正常,除了應該說“請稍候”的模式彈出窗口在應要求用戶等待的延遲之后閃爍一秒鍾。 也就是說,在Ajax調用完成后而不是之前彈出模式。

頁面加載時,它將調用AjaxInitialUpdate 這很好。

問題是當您單擊調用AjaxChangePassword的按鈕時。

該功能應該拉起一個模態,然后與Web服務器聯系,最后刪除模型並調用AjaxInitialUpdate函數以刷新整個屏幕。

問題在於,直到Web查詢完成為止, AjaxChangePassword模態才會彈出(此時,告訴用戶沒有任何意義-請稍候)。

現在,我在這里完全是自學成才,所以我可能用錯誤的名稱或術語來稱呼事物。 我歡迎任何使它運行更好的想法,但是請詳細說明一下,我仍然是Java的新手。

另外,上一次我做任何形式的HTML編程都是在樣式表成為主流之前,所以我也必須學習它們(並刷新其余所有內容,因此請詳細解釋任何答案) 。

最后,它的服務器端是用Powershell編寫的,並且是單線程的,因此我試圖盡可能多地將其放入HTML文件中,而不是調用諸如樣式表和圖像之類的輔助文件。

<!DOCTYPE html>    
<head>    
<meta http-equiv="X-UA-Compatible" content="IE=edge">    
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />    
<meta http-equiv="Pragma" content="no-cache" />    
<meta http-equiv="Expires" content="0" />    
<meta name="viewport" content="width=device-width, initial-scale=1">    
<style>    

body {font-family: Arial, Helvetica, sans-serif;}    


/* The Modal (background) */    
.modal {    
  display: none; /* Hidden by default */    
  position: fixed; /* Stay in place */    
  z-index: 1; /* Sit on top */    
  padding-top: 100px; /* Location of the box */    
  left: 0;    
  top: 0;    
  width: 100%; /* Full width */    
  height: 100%; /* Full height */    
  overflow: auto; /* Enable scroll if needed */    
  background-color: rgb(0,0,0); /* Fallback color */    
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */    

  /* Believe these are not needed.
     Imported from web site that I copied the code from.
  padding: 8px 8px;    
  outline: none;    
  border: none;    
  border-radius: 115px;        
  box-shadow: 0 3px #999; */    
}    


/* Modal Content */    
.modal-content {    
  background-color: #fefefe;    
  margin: auto;    
  padding: 20px;    
  border: 1px solid #888;    
  width: 70%;    
}    

/* The Close Button */    
.close {    
  color: #aaaaaa;    
  float: right;    
  font-size: 28px;    
  font-weight: bold;    
}    

.close:hover,    
.close:focus {    
  color: #000;    
  text-decoration: none;    
  cursor: pointer;    
}    


#IndividualSystem {    
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;    
  border-collapse: collapse;    
  width: 100%;    
  border: 1;    

}    

#IndividualSystem td, #IndividualSystem th {    

  text-align: left;    
  padding: 8px;    
  color: black    
  border: 1px solid black;    
}    


#IndividualSystem tr {    
  padding-top: 12px;    
  padding-bottom: 12px;    
  text-align: left;    
  background-color: #eeeeee;    
}    

.tab { margin-left: 40px; }    

.button {    
  display: inline-block;    
  padding: 8px 8px;    
  font-size: 12px;    
  cursor: pointer;    
  text-align: center;    
  text-decoration: none;    
  outline: none;    
  color: #fff;    
  background-color: #4CAF50;    
  border: none;    
  border-radius: 15px;        
  box-shadow: 0 3px #999;     
}    

.button:hover {background-color: #3e8e41}    

.button:active {    
  background-color: #3e8e41;    
  box-shadow: 1 5px #666;       
  transform: translateY(4px);    
}    

.button2 {    
  display: inline-block;    
  padding: 8px 8px;    
  font-size: 12px;    
  cursor: pointer;    
  text-align: center;    
  text-decoration: none;    
  outline: none;    
  color: #fff;    
  background-color: #000080;    
  border: none;    
  border-radius: 15px;        
  box-shadow: 0 3px #999;     
}    

.button2:hover {background-color: #df330e}    

.button2:active {    
  background-color: #FD2E02;    
  box-shadow: 1 5px #666;       
  transform: translateY(4px);    
}    

#IndividualSystem {    
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;    
  border-collapse: collapse;    
  width: 100%;    
  border: 1;    

}    

</style>    

<Title>Cyber Track</title>    
</head>    

<body>    
<table>    
    <tr>    
        <td>blah</td>    
        <td><h1>Systems and Passwords</H1>    
        <h3>Information within this page is considered confidential.</h3>    
    </td></tr>    
</table>    

<hr>    


<input type="hidden" id="Leftlink" name="Leftlink" value="0">    
<input type="hidden" id="Rightlink" name="Rightlink" value="0">    
<input type="hidden" id="serverID" name="serverID" value="server8\admin-server8">    
<input type="hidden" id="count" name="count" value="10">     <!---  Number of servers per page on server list //-->    

<!-- The Modals #1 -->    

<div id="myModal1" class="modal">    

    <!-- Modal content -->    
        <div class="modal-content">    
            <h4><label id="ModalTextLine1">Loading content from server</label></h4>    
        </div>    
</div>    

<!-- The Modals #2 -->    
<div id="myModal2" class="modal">    
    <!-- Modal content -->    
        <div class="modal-content">    
            <span class="close2">&times;</span>    
            How long do you need the password?    

                <form action='#'>    
                <select name="days">    
                <option value='1' >1 day or less</option>     
                <option value='7'>between 1 and 2 days</option>     
                <option value='7'>between 2 and 7 days</option>     
                <option value='30'>between 7 and 30 days</option>     
                <option value='365' selected>for up to a year.</option>     
                </select>    
                <br>    
                <input type="submit" value="Process Request">    
            </form>    
        </div>    
</div>    

<script>    
// Get the modal    
var modal2 = document.getElementById('myModal2');    

// Get the <span> element that closes the modal    
var span = document.getElementsByClassName("close2")[0];    

// When the user clicks on <span> (x), close the modal    
span.onclick = function() {    
  modal2.style.display = "none";    
}    

// When the user clicks anywhere outside of the modal, close it (or actually, just hide it)    
window.onclick = function(event) {    
  if (modal2.style.display != "none")    
  {    
    if (event.target == modal2) {    
        modal2.style.display = "none";    
    }    
  }    
}    
</script>    

<!-- End Loaded from function -->    

<table id="IndividualSystem">  <!-- IndividualSystem - to define needed style sheet //-->    
<tr>    
    <td style="width: 215px;">Server</td>    
    <td style="width: 259px;"><label ID="DynServerName">Loading</label></td>    
</tr>    
<tr>    
    <td style="width: 215px;">User ID</td>    
    <td style="width: 259px;"><label ID="DynAdminID">Loading</label></td>     
</tr>    
<tr>    
    <td colspan="2"><hr></td>    
</tr>    
<tr>    
    <td style="width: 215px;">Checked out status:</td>    
    <td style="width: 259px;"><label ID="DynLastCheckedout">Loading</label></td>    
</tr>    
<tr>     
    <td style="width: 215px;" valign='top' >Last checked out by:</td>    
    <td style="width: 259px;" valign='top' ><label ID="DynLastCheckedBy">Loading...</label>&nbsp;&nbsp;&nbsp;    
                 <button class="button" onclick="javascript:AjaxCheckOutPassword()" id="PassStatus">Loading</button> <!--  AjaxCheckOutPassword -->    
    </td>    
</tr>    
<tr>    
    <td valign='top' style="width: 215px;">Expected Check In Date:</td>    
    <td valign='top' style="width: 259px;"><label ID="DynExpectedBack">Loading</label></td>    
</tr>    
<tr>    
    <td style="width: 215px;">Date of last password change:</td>    
    <td style="width: 259px;"><label id="DynLastReset">Loading</label>&nbsp;&nbsp;&nbsp;<button class="button2" onclick="AjaxChangePassword()">Force Change Now!</button>    
                  </td>    
</tr>    
<tr>    
    <th colspan="2">Notify:<br>    
        <table border="1" padding = "0" width=100%>    
            <tr>    
                <td width=200>On Use:</td><td><label id="DynEmailCheckOut">Loading</label></td>    
            </tr>    
            <tr>    
                <td width=200>On Checkin:</td><td><label id="DynEmailCheckIn">Loading</label></td>    
            </tr>    
        </table>    
    </th>    
</tr>    
<tr><td colspan="2">    
        <label ID="DynAccountPurpose"></label>    
</td></tr>    

</tbody>    
</table>    

<!-- Page Footer (if any) //-->    

<!-- Page links left/up/right //-->    
<table>    
<tr><td width = 50>    
    <label id="Show-Left">    
        <a class='w3-left w3-btn' href='#' onclick="AjaxNavigate(-1)" text='Prior Server'>    
                     <img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAgABoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9+Wwp/wDrVzHxS+Kmk/B3wfda3rdz9lsbPZ5kvlvJ951QfKis3V1HA7074ofE/SPhD4RvNc1m5+x6fZ7PNl8t5Nu50ReFBJyzgcDv6Dj853k8Zf8ABW/4sgY/sv4d6T0X9zPjzIfX9xNzPae/X+6Ob9naPtJ7GXM5Plgfod8H/jHoXxw8FW3iDw7c/btPvt4WTy5I87JHj6SKp+8jfwj8etddvHp+hrm/hb8L9H+EnhO30PQ7f7JZWe7am93xvdnPLsx6sT1P8q6QcDjbjt8prGPdm0rHjv7Yf7JOj/tW/DuTS9Q/0e6jx5M+Hfyv3sTt8qyIDkRAc9O1fH/7GP7T+t/sN+P4/hD8TB5OnQ5+yXX7t/s+Y5rt/kt45C2WmiHMnGeOMgfpEWJb73H0614v+2N+x1oP7WfgiTT9SBt7+HBtrr94/lZkhZvkWRAciEDn8OldCqc0fZzMJU+WXNA9hsb9NQtVlhfdG2drYIzg4PWp8r/drzb9lv4I3fwH+EWn+HNQ1X+2JrPzM3H2YW+7dNLJ90MwGBIB949Pwr0kx8/d/SsIO2jOjRn/2Q==' alt='go to prior server' height='26' width='32'>    
        </a>    
    </label>    
    &nbsp;    
   </td>    
   <td>    
            <a class='w3-left w3-btn' href='#' onclick="AjaxNavigate(0)" text='Next server'>Return to main list</a>    
   </td>    
   <td width = "50">    
   <label id="Show-Right">    
        <a class='w3-left w3-btn' href='#' onclick="AjaxNavigate(1)" text='Next server'>    
                    <img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAgABoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD97dc1U6Zp000cfnPHt+Tdt3ZIHX8a+Z/2Sv8AgpDpfx98c3/hjWNP/wCEf16Dy/Kt/Pe78zMcsp+ZYVQYSMHk/wAXqK+oihPT8DXx7/wUM/4J8r8Wo4/GXg5fsfi7T85XPmfat/2eH/lrMsabYkf+E5z64NEHGM+WezFUTcbw3PsMgtjj6nNO8pfSvjn/AIJv/wDBRD/hoLTj4b8UDyPFFr99s7vtG43Eg4jhWNdsca9+frmvsPa3/PX/AMdrSdKUHZkQqxmtCPULyK1tXef5YVxuPJ7+3PWvzt/a4/a28S/tm/Ek/Cz4V/vrOX/j7u/3S+ZiKK6T5LmOMjBhlHD+57A/ofqenQ6hbPFP80BxuXkdwRyOetef/Aj9lXwh+zpHer4a077AL7y/NP2iaXds34/1kj4/1jdPWsYqLneey/E0nJqP7vcwv2Ov2OdD/ZM+H/8AZunjzr64/wCPy7zIv2jbJMyfI0jhdolI4PPU+3su5fX9KAdwyRgntmn7hWs6spvmkZwpRjsf/9k=' alt='go to prior server' height='26' width='32'>    
        </a>    
   </label>    
   &nbsp;    
  </td>    
</tr></table>    

<!-- End Page links left/up/right //-->    

<!-- Dynamic JAVA Script Section //-->    

<script>    

// disable our NAV pointers till later where we may re-enable them.    
document.getElementById('Show-Right').style.display = 'none';    
document.getElementById('Show-Left').style.display = 'none';    

//
//  This is the specific function that I need help with.
//  Why does this modal pop up only after the actual query is done?
//    
function AjaxChangePassword(){    

    document.getElementById('myModal1').style.display = "block";    
    document.getElementById('myModal2').style.display = "none";   // Make sure its not poped up..    
    // we need to set item on the modal to explain what we are doing...    
    document.getElementById("ModalTextLine1").innerHTML="Processing password change request.  Please Wait"   

    var xhr = "";    
    var xhr = new XMLHttpRequest();    

    // server will check if values are valid..    
    var Server = document.getElementById("DynServerName").innerHTML;    
    var AdminID = document.getElementById("DynAdminID").innerHTML;    

    xhr.open('GET', 'http://PSShellSrv.mydomain.local:80/CyberPass3/?command=update&sub=change&server=' + Server + '/' + AdminID+'&NoCache=' + ((new Date()).getTime()), true);    

    xhr.responseType = 'text';    

    xhr.onload = function () {    
        console.log('Initail Comment Response onpassword change.');    
        if (xhr.readyState === xhr.DONE) {    
            if (xhr.status === 200) {    
                console.log(xhr.response);    
                console.log("Report password changed.");    
                AjaxInitialUpdate() // password changed, lets refresh.    
            };    
        };    

    };    
    xhr.send(null);    
    document.getElementById('myModal1').style.display = "none";    
};    


// Navigate left and right..    
function AjaxNavigate(link)    
{    

    xx = document.getElementById('Leftlink').value    

    xx = document.getElementById('Rightlink').value    

    if (link == 0)    
    {    
        // Back to the main page.  Get the values that make who we are -- servername and count.    
        var count = document.getElementById('count').value;    
        var CurrentSystem = document.getElementById('serverID').value;    
        var x = '/CyberPass3/?command=homepage&server=' + CurrentSystem + '&count='+ count + '&NoCache=' + ((new Date()).getTime());    

        location.replace('/CyberPass3/?command=homepage&server=' + CurrentSystem + '&count='+ count + '&NoCache=' + ((new Date()).getTime()));    
    }    
    else    
    {    
        if (link == 1)    
        {    
            document.getElementById('serverID').value  = document.getElementById('Rightlink').value    
        } else {            
            document.getElementById('serverID').value = document.getElementById('Leftlink').value    
        }    

        // we've moved left or right.  Lets update.    
        AjaxInitialUpdate()    
    }    

}    

function AjaxCheckOutPassword() {    

                console.log("Checkout Code not yet written");    
};    


function AjaxInitialUpdate() {    
    var xhr = ""    
    var xhr = new XMLHttpRequest();    
    var count = document.getElementById('count').value;    
    var link = document.getElementById('serverID').value    
    document.getElementById('myModal1').style.display = "block";   // show we are updating everything..    
    document.getElementById('myModal2').style.display = "none";   // should already be hidden, but lets make sure..    
    xhr.open('GET', 'http://PSShellSrv.mydomain.local:80/CyberPass3/?command=update&sub=refresh&server=' + link + '&count=' + count + '&NoCache=' + ((new Date()).getTime()), true);    
    xhr.responseType = 'text';    

    xhr.onload = function () {    
        console.log('Initail Response.');    
        if (xhr.readyState === xhr.DONE) {    
            if (xhr.status === 200) {    

                WebFields = xhr.responseText.split("|");    

                document.getElementById("DynServerName").innerHTML = WebFields[0];    
                document.getElementById("DynAdminID").innerHTML = WebFields[1];    
                document.getElementById("DynLastCheckedout").innerHTML = WebFields[2];    
                document.getElementById("DynLastCheckedBy").innerHTML = WebFields[3];    
                document.getElementById("DynExpectedBack").innerHTML = WebFields[4];    
                document.getElementById("DynLastReset").innerHTML = WebFields[5];    
                document.getElementById("PassStatus").innerHTML = WebFields[6];    
                document.getElementById("DynEmailCheckIn").innerHTML = WebFields[7];    
                document.getElementById("DynEmailCheckOut").innerHTML = WebFields[8];    
                // if no comment, don't even dispay the table cells.    
                if (WebFields[9].slice(0,1) == "{" && WebFields[9].slice(-1) == "}" && WebFields[9] != "{}" )    
                {    
                   var res = WebFields[9].split("{");    
                   var res = res[1].split("}")[0];    
                   document.getElementById("DynAccountPurpose").innerHTML = "<tr><td style='width: 474px;' colspan='2'><p><b>Account Comments:</b></p><p class='tab'>" + res + "</p></td></tr>";    
                   }    
                else    
                {    
                    document.getElementById("DynAccountPurpose").innerHTML = "";    
                    console.log("No Comment");    
                };    

                // lets populate the nav buttons..    
                if (WebFields[10] == '\\')    
                {    
                    // hide go left    
                    document.getElementById('Show-Left').style.display = 'none';    
                    document.getElementById("Leftlink").value = "0/0"    
                }    
                else    
                {    
                    //Enable go left    
                    document.getElementById('Show-Left').style.display = 'block';    
                    document.getElementById('Leftlink').value  = WebFields[10];    

                };    


                // lets populate the nav buttons..    
                if (WebFields[11] == "\\")    
                {    
                    // hide go right    
                    document.getElementById('Show-Right').style.display = 'none';    
                    document.getElementById("Rightlink").value = "0/0";    
                }    
                else    
                {    
                    // Enable go right    
                    document.getElementById('Show-Right').style.display = 'block';    
                    document.getElementById("Rightlink").value  = WebFields[11];    
                };    
                document.getElementById('myModal1').style.display = "none";    
            }    
            if (xhr.status === 403) {    
                console.log(xhr.response);    
                document.getElementById("PassStatus").innerHTML = 'Access Denied';    
            }    
            if (xhr.status === 404) {    
                console.log(xhr.response);    
                document.getElementById("PassStatus").innerHTML = 'Unable to load';    
            };    
        }    
        else    
        {    
            document.getElementById("PassStatus").innerHTML = "Failed";    
        };    
};    

xhr.send(null);    

};    

// Now, load the initial value..    
window.onload = AjaxInitialUpdate();    

</script>    

當我調用AjaxChangePassword()時 ,我希望模式在查詢之前打開。 現在,如果在頁面加載后但在啟動此功能之前停止服務器,則模態永遠不會彈出,然后一旦啟動服務器端備份,就會看到查詢進入並獲得答案,僅然后它會彈出,然后只持續一秒鍾。

我所說的方式我做錯了什么?

當我查看您的代碼時,發現首先在函數AjaxChangePassword中打開了模式,然后調用了ajax,然后關閉了模式,問題是基本上javascript是同步執行的,但是如果存在ajax調用,那么它將異步執行,因此根據您的模式打開並然后調用ajax,直到ajax忙於獲取響應,然后再執行下一行,即該行用於模式關閉,這種情況發生在ms的幾分之一內,所以您什么也看不到。在AjaxChangePassword中,回調方法是AjaxInitialUpdate,在此方法中,您先打開模式,然后關閉,但是請記住,在此方法中,您在回調方法中已關閉模式,因此它會出現一段時間,根據我的看法,您只需刪除即可

document.getElementById('myModal1').style.display = "none";

下面的AjaxChangePassword方法中的這一行已更正AjaxChangePassword函數

    function AjaxChangePassword(){    

    document.getElementById('myModal1').style.display = "block";    
    document.getElementById('myModal2').style.display = "none";   // Make sure its not poped up..    
    // we need to set item on the modal to explain what we are doing...    
    document.getElementById("ModalTextLine1").innerHTML="Processing password change request.  Please Wait"   

    var xhr = "";    
    var xhr = new XMLHttpRequest();    

    // server will check if values are valid..    
    var Server = document.getElementById("DynServerName").innerHTML;    
    var AdminID = document.getElementById("DynAdminID").innerHTML;    

    xhr.open('GET', 'http://PSShellSrv.mydomain.local:80/CyberPass3/?command=update&sub=change&server=' + Server + '/' + AdminID+'&NoCache=' + ((new Date()).getTime()), true);    

    xhr.responseType = 'text';    

    xhr.onload = function () {    
        console.log('Initail Comment Response onpassword change.');    
        if (xhr.readyState === xhr.DONE) {    
            if (xhr.status === 200) {    
               document.getElementById('myModal1').style.display = "none";  
                console.log(xhr.response);    
                console.log("Report password changed.");    
                AjaxInitialUpdate() // password changed, lets refresh.    
            };    
        };    

    };    
    xhr.send(null);  
}; 

並檢查。 我可能是錯的,但請檢查一下。

暫無
暫無

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

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