I have an ajax function that can be called by more than one part of my
web application, so I would like to have some sort of callback
function.
So, here is one function:
showCardsInPopup:function(e) {
Card.callbackFunc = Reader.displayCardsInPopup;
Card.getCardsByDeckId(e);
},
Card.callbackFunc is to be used when I get the response from the ajax
call, but I need to call the function with parameters.
So, how can I some something like:
var myObj = "some object returned from server";
callbackFunc(myObj);
I could build it up as a string, and call eval, but I don't really
like that approach, and hope there is a better way.
Thank you.