79130804

Date: 2024-10-27 14:47:50
Score: 4
Natty: 4
Report link

I need your help because i can't callback the value from the function

look my example:

var data = askQuestion('Are you sure want to continue without adding a server', function(val){
return val; });

console.log(data);

function askQuestion(msg, callback){ $.confirm({

                      title: '',
                      content: msg,
                      type: 'dark',
                      theme: 'light',
                      animation: 'none',
                      animateFromElement: false,
                      columnClass: 'medium',
                      onContentReady: function () {
                          
                      },
                      buttons: {
                          ok: {
                              text: 'Συνέχεια',
                              btnClass: 'btn-dark float-right',
                              action: function(){
                                      
                                    callback(56);
                                    
                              }//end action
                          },//end ok
                          close: {
                                text: 'Ακύρωση',
                                 btnClass: 'btn-dark float-left',
                                 action: function(){
                                      
                                    callback(59);
                                    
                              }//end action
                          }
                        
                      }
                      
            });   

}

How i can to return val into "data" variable and print after that in console.log?

console.log now is not working callback;

i want to check variable 56 or 59 and ONLY if i have result 56 or 57 to continue my code.

Please little help

Reasons:
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (2): I need your help
  • RegEx Blacklisted phrase (1): i want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user28010850