delete_member_test2.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {% extends "index.html" %}
  2. {% block title %}登入{% endblock %}
  3. {% block head %}
  4. {{ super() }}
  5. {% endblock %}
  6. {% block body %}
  7. <script >
  8. function parseCookie() {
  9. var cookieObj = {};
  10. var cookieAry = document.cookie.split(';');
  11. var cookie;
  12. for (var i=0, l=cookieAry.length; i<l; ++i) {
  13. cookie = jQuery.trim(cookieAry[i]);
  14. cookie = cookie.split('=');
  15. cookieObj[cookie[0]] = cookie[1];
  16. }
  17. return cookieObj;
  18. }
  19. function getCookieByName(name) {
  20. var value = parseCookie()[name];
  21. if (value) {
  22. value = decodeURIComponent(value);
  23. }
  24. return value;
  25. }
  26. </script>
  27. <form method="post" action="member_delete">
  28. <h2>delete_member</h2>
  29. <input type="text" id="access_token" name="access_token" >
  30. <div>
  31. <label>帳號</label>
  32. <input type="text" id="del_name" name="del_name" placeholder="請輸入帳號">
  33. <button id="btn_delete" type="submit">輸入</button>
  34. </form>
  35. <script>
  36. var cookie_token = getCookieByName('jwt_token');
  37. $('#access_token').val(cookie_token);
  38. alert(document.getElementById=('access_token').value);
  39. </script>
  40. {% endblock %}