Replace Zepto with ki.js, rewrite all JS
[plack-app-gruntmaster.git] / js / 90-form.js
CommitLineData
7093e9ba
MG
1$(function(){
2 $('.jsform > input[type="submit"]').on('click', function(e){
3 var form_data = new FormData(this.parentElement);
4 var form = this.parentNode;
5 var xhr = new XMLHttpRequest();
6 xhr.open(form.getAttribute('method'), form.getAttribute('action'));
7 xhr.onload = function() {
8 $('#result')[0].innerHTML = this.responseText;
9 };
10 xhr.onerror = function() {
11 $('#result')[0].innerHTML = 'Error!';
12 };
13 window.scrollTo(0, 0);
14 $('#result')[0].innerHTML = 'Loading...';
15 xhr.send(form_data);
16 e.preventDefault();
eef56f7a 17 });
7093e9ba 18});
This page took 0.016751 seconds and 4 git commands to generate.