I have an "ic" value in the list and a predefined "og" value assigned to the button. Those values match in another table. I send to PHP file via ajax and I want it to confirm from the user the value in the result returned with ajax as a message. If cancel will return false and interrupt the process, but I don't know why couldn't succeed.
How can I handle confirm(sttMsg) and stop button action?
function statusMethod() {
  var sttMsg = "";
  jQuery.each(rows, function(rowid, row) {
    var ic = row.cat_a_req___task_status_raw;
    var og = 'close';
    jQuery.ajax({
      type: "POST",
      url: "/spc/statusCheck/check.php",
      data: {
        incoming: ic,
        outgoing: og
      },
      dataType: "json",
      success: function(data) {
        sttMsg = data.checkMsg;
      },
      async: false
    });
    return confirm(sttMsg);
  });
}
return statusMethod(); 
     
    