Skip to content

Instantly share code, notes, and snippets.

@danyliak
Created July 20, 2015 20:24
Show Gist options
  • Select an option

  • Save danyliak/1a781baade0e41b83c9b to your computer and use it in GitHub Desktop.

Select an option

Save danyliak/1a781baade0e41b83c9b to your computer and use it in GitHub Desktop.

Revisions

  1. danyliak created this gist Jul 20, 2015.
    17 changes: 17 additions & 0 deletions common.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    //Аякс отправка форм
    //Документация: http://api.jquery.com/jquery.ajax/
    $("#main_form").submit(function() {
    $.ajax({
    type: "POST",
    url: "mail.php",
    data: $(this).serialize()
    }).done(function() {
    alert("Спасибо за заявку!");
    setTimeout(function() {

    $("#form").trigger("reset");
    console.log("jjj");
    }, 1000);
    });
    return false;
    });