{% extends "index.html" %}
{% block title %}登入{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}


{% block body %}
<script >
  function parseCookie() {
    var cookieObj = {};
    var cookieAry = document.cookie.split(';');
    var cookie;
    
    for (var i=0, l=cookieAry.length; i<l; ++i) {
        cookie = jQuery.trim(cookieAry[i]);
        cookie = cookie.split('=');
        cookieObj[cookie[0]] = cookie[1];
    }
    
    return cookieObj;
}


function getCookieByName(name) {
    var value = parseCookie()[name];
    if (value) {
        value = decodeURIComponent(value);
    }

    return value;
}
  
  
</script>

  
  <form method="post" action="member_delete">
    <h2>delete_member</h2>
    <input type="text" id="access_token" name="access_token" >
    <div>
      <label>帳號</label>
      <input type="text" id="del_name" name="del_name" placeholder="請輸入帳號">
    <button id="btn_delete" type="submit">輸入</button>
  </form>
  <script>
    var cookie_token = getCookieByName('jwt_token');
      $('#access_token').val(cookie_token);
      alert(document.getElementById=('access_token').value);
      </script>
  
{% endblock %}
