Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('form.ajax').on('submit', function() {
- var current = $(this),
- url = current.attr('action'),
- type = current.attr('method'),
- data = [];
- current.find('[name]').each(function(index, value) {
- var current = $(this),
- name = current.attr('name'),
- value = current.val();
- data[name] = value;
- });
- $.ajax({
- url: url,
- type: type,
- data: data,
- success: function(response) {
- console.log(response);
- }
- });
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement