| 1 |
(function ($) { |
| 2 |
$(document).on('click', '.dci-button-allow, .dci-button-skip', function () { |
| 3 |
$.ajax({ |
| 4 |
url: DCI_SDK.ajax_url, |
| 5 |
type: 'POST', |
| 6 |
data: { |
| 7 |
action: 'dci_sdk_insights', |
| 8 |
button_val: this.value, |
| 9 |
nonce: DCI_SDK.nonce |
| 10 |
}, |
| 11 |
success(response) { |
| 12 |
console.log(response); |
| 13 |
if (response.status === 'success') { |
| 14 |
location.reload(); |
| 15 |
} else { |
| 16 |
alert(response.message); |
| 17 |
} |
| 18 |
} |
| 19 |
}); |
| 20 |
}); |
| 21 |
|
| 22 |
$(document).on('click', '.dci-global-notice .notice-dismiss', function () { |
| 23 |
$.ajax({ |
| 24 |
url: DCI_SDK.ajax_url, |
| 25 |
type: 'POST', |
| 26 |
data: { |
| 27 |
action: 'dci_sdk_dismiss_notice', |
| 28 |
nonce: DCI_SDK.nonce |
| 29 |
} |
| 30 |
}); |
| 31 |
}); |
| 32 |
})(jQuery); |
| 33 |
|