Ajax button and sc_confirm

Hi,
in a control form I have an ajax button to validate some data entered by the user with checks on sql data and blocks in the code (sc_exit) if they do not respect the parameters.
Now I have a situation of checking parameters and intermediate blocks of the code or respecting all the parameters and saving the data.
I would also like to add confirmation messages to continue in case we are close to exceeding the parameters, such as sc_confirm.
But sc_confirm doesn’t work in ajax buttons.
I am trying various methods with no solution.
Does anyone know how to do?
thank you

You cannot do this on the server side it as to be on the client side, ex. in javascript

Somethig like this

if (confirm(‘Continue?’)) {
//Code to execute if true
$.ajax({
url: ‘myUrl’,
type: “POST”,
data: {
// data to save
},
} else {
// code to execute if false
}

in fact I tried to insert a sc_ajax_javascript (‘confirm‘) in the code;
but I can’t find the way to stop the code until the user has chosen yes on the confirmation mask