-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

5
  • What is callLib? Commented Jun 1, 2016 at 4:09
  • 1
    "Is it a possible?" ? Have you tried it ? What did not work ? Commented Jun 1, 2016 at 4:10
  • Should it not be callback(destination) supposing you passed myCallback to testCallback Commented Jun 1, 2016 at 4:10
  • callLib is an external library that I can only pass a callback with one parameter Commented Jun 1, 2016 at 4:31
  • This one is not duplicate to the above. May be it is my enlist mistake Commented Jun 1, 2016 at 4:35

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.