- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- <script src="/static/dist/js/jquery-3.1.1.js"></script>
- </head>
- <body>
- <form action="/icbc.html" method="post">
- {% csrf_token %}
- <input type="text" name="from">
- <input type="text" name="to">
- <input type="text" name="money">
- <input type="submit" value="转账">
- <a onclick="ajaxSubmit();">Ajax提交</a>
- </form>
- <script>
- function ajaxSubmit() {
- $.ajax({
- url: 'icbc.html',
- type: 'POST',
- data: {'k1': 'v1', 'k2': 'v2', 'csrfmiddlewaretoken': $('input[name="csrfmiddlewaretoken"]').val()},
- success: function (arg) {
- console.log(arg)
-
- }
- })
- }
- </script>
- </body>
- </html>
posted @
2017-09-22 15:17
xp5
阅读(
154)
评论()
编辑
收藏
举报