算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
758 B

$(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
7 years ago
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
7 years ago
$('form').each(function () {
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
this.appendChild(input);
});
});