]> iEval git - gruntmaster-page.git/blob - js/90-form.js
Remove Link header
[gruntmaster-page.git] / js / 90-form.js
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 window.scrollTo(0, 0);
17 $('#result').html('Loading...');
18 xhr.send(form_data);
19 return false;
20 });
21 });
22 })();
This page took 0.05311 seconds and 4 git commands to generate.