reset_pwd.js 468 B

1234567891011121314151617181920212223242526
  1. $(".sender").click(function () {
  2. var pwd = $("#in_pwd").val;
  3. var code = $("#code").val;
  4. var url = "/reset_pwd";
  5. var xhr = new XMLHttpRequest();
  6. xhr.open("POST", url);
  7. xhr.setRequestHeader("accept", "application/json");
  8. xhr.setRequestHeader("Content-Type", "application/json");
  9. xhr.onreadystatechange = function () {
  10. if (xhr.readyState === 4) {
  11. alert('重設成功')
  12. }};
  13. var data = {
  14. "code": code,
  15. "password": pwd
  16. };
  17. xhr.send(data);
  18. });