

$(".sender").click(function () {

  var pwd = $("#in_pwd").val();
  var code = $("#code").val();
  
  var url = "/reset_pwd";

  var xhr = new XMLHttpRequest();
  xhr.open("POST", url);

  xhr.setRequestHeader("accept", "application/json");
  xhr.setRequestHeader("Content-Type", "application/json");

  xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
        alert('重設成功')
    }};

  var data = `{"code":"`+ code+`","password":"`+pwd+`"}`

  xhr.send(data);
});



var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("c");
console.log(c);