Advertisement
Guest User

Untitled

a guest
May 30th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.88 KB | None | 0 0
  1.    $(document).ready(function () {
  2.        ['/reporting', 'reposting/formData', '/reporting/chart/monatlicheGesamtsummeChart', 'reporting/chart/reseller_id/gewünscht'].forEach(function(val,ind){
  3.            var date = $("#datesFilter option:selected").val();
  4.            var filter = $("#filter option:selected").val();
  5.            $.ajax({
  6.                type: "POST",
  7.                url: val,
  8.                data:  {filtersDate:date, filter: filter, _token: $('input[name=_token]').val()} ,
  9.                success: function(res){
  10.                    console.log('success');
  11.                }
  12.  
  13.            }).done(function() {
  14.                alert( "second success" );
  15.            })
  16.                .fail(function() {
  17.                    alert( "error" );
  18.                })
  19.                .always(function() {
  20.                    alert( "finished" );
  21.                });
  22.  
  23.        });
  24.    });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement