1jQuery(document).ready(function($) { 2 3 4 $(document).on("click", ".dev-ajax-add-to-cart", function(e) { 5 e.preventDefault(); 6 var $this = $(this); 7 if (!$this.hasClass('loading')) { 8 var $id = $this.attr('data-id'); 9 $.ajax({ 10 url: dev_ajax_url.ajaxURL, 11 type: "post", 12 data: { 13 action: "dev_ajax_add_to_cart_btn", 14 id: $id, 15 }, 16 error: function(request) { 17 $this.removeClass("loading"); 18 }, 19 beforeSend: function(response) { 20 $this.addClass("loading"); 21 }, 22 success: function(data) { 23 $this.removeClass("loading"); 24 let $result = JSON.parse(data); 25 if ($result['status'] == 'success') { 26 window.location.href = $result["message"]; 27 } 28 if ($result["status"] == "error") { 29 Swal.fire({ 30 title: $result["message"], 31 icon: "error", 32 timer: 10000, 33 }); 34 } 35 }, 36 }); 37 } 38 }); 39}); 40
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.