Guest User

Untitled

a guest
Jul 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. swal({
  2. title: 'Auto close alert!',
  3. html: 'I will close in <strong></strong> seconds.',
  4.  
  5. onOpen: () => {
  6. var ano = $('.slt-ano').val()
  7. swal.showLoading()
  8. $.ajaxSetup({
  9. headers: {
  10. 'X-CSRF-TOKEN' : $('meta[name="csrf-token"]').attr('content')
  11. }
  12. })
  13. return $.ajax({
  14. url : '{{ route('medicao.getDadosToGrapsh') }}',
  15. type: 'post',
  16. dataType: 'json',
  17. data: {
  18. ano : ano
  19. }
  20.  
  21. }).done((r)=>{
  22. return r
  23. })
  24.  
  25. },
  26.  
  27. }).then((result) => {
  28. console.log( result )
  29. if (
  30. // Read more about handling dismissals
  31. result.dismiss === swal.DismissReason.timer
  32. ) {
  33. console.log('I was closed by the timer')
  34. }
  35. })
Add Comment
Please, Sign In to add comment