November 23, 2012
execute string as javascript function
Question by chugh97
My object has a call back:
var MyObject = {
CallBack: "function (whichSubMenuIsClicked, subMenuObjectTag) { self.doStuff(whichSubMenuIsClicked.SubMenuItem, whichSubMenuIsClicked.HeaderColumnName, whichSubMenuIsClicked.DivIdentifier);}",
}
The callback is a string. Now I need to execute it using MyObject.CallBack(param1, param2)
How can this be done using jquery or javascript. The self in this case is the original widget calling another widget. Thus the call back is on the original widget.