pedroz;11031171 wrote:
I would like to get the word 'test' from the callback function psCallback below.
The function psCallback is already returning 'test'.
pedroz;11031171 wrote:
alert(opt); is now displaying the word 'test'
Isn't it displaying something like "object Object"?
pedroz;11031171 wrote:
What am I doing wrong?
If all you want to do is call psCallback and use its output with alert, this would do
alert(psCallback());
Similarily, if what you want to do is call the function specified by the member "callback" of your anonymous object which has an instance assigned to opt,
alert(opt.callback());