script.js 428 B

1234567891011121314151617181920
  1. (function($) {
  2. $(document).ready(() => {
  3. $('a.catch').click(e => {
  4. const link = $(e.target);
  5. console.log(link);
  6. e.preventDefault();
  7. $.ajax({
  8. type: link.data('method'),
  9. url: link.attr('href'),
  10. dataType: 'json',
  11. success: data => {
  12. console.log(data);
  13. },
  14. error: () => {
  15. console.log(arguments);
  16. }
  17. })
  18. })
  19. });
  20. })(jQuery)