-2

I would like to pass some parameter in call back like the following example. Is it a possible? Or I need to do it in another way?

function testCallback(callback, destination){
    // how can I pass the destination to callback
    callLib(callback)
}

function myCallback(destination){
    //do something
}

callLib is an external library that accept. I guess the interface should be like this

function callLib(callback){
    callback("something")
}

this one I think is not duplicate one. Sorry for my bad english. I have already change the question. see if you understand what the problem is

travistam
  • 43
  • 8

1 Answers1

0

I played with callbacks all day to learn how to do this. Here is some example code: https://stackoverflow.com/questions/37554672/jqueryui-dialog-doesnt-stop-code-to-wait-for-user-input/37556573#37556573

Community
  • 1
  • 1