]>
Commit | Line | Data |
---|---|---|
eef56f7a MG |
1 | (function(){ |
2 | 'use strict'; | |
3 | ||
4 | $( document ).ready(function(){ | |
5 | $('.jsform').on('click', 'input[type="submit"]', function(e){ | |
6 | var form_data = new FormData(this.parentElement); | |
7 | var form = $(this).parent(); | |
8 | var xhr = new XMLHttpRequest(); | |
9 | xhr.open(form.attr('method'), form.attr('action')); | |
10 | xhr.onload = function() { | |
11 | $('#result').html(this.responseText); | |
12 | }; | |
13 | xhr.onerror = function() { | |
14 | $('#result').html('Error!'); | |
15 | }; | |
16 | $('#result').html('Loading...'); | |
17 | xhr.send(form_data); | |
18 | return false; | |
19 | }); | |
20 | }); | |
21 | })(); |