//RULES // 1. Promises buttons should have class '.promises_stat_button'. // class=".promises_stat_button" // 2. Promises buttons should have data-type attribute. Supports only "yes" or "no" values. // data-type="yes" // Example of buttons html code: //
jQuery(document).on('click', '.promises_stat_button', function(){ let _type = $(this).data('type'); let _url = '/traffic_api/add_promises_stat?type='+_type; $.get( _url, function( data ) { console.log(data); }); });