Can you share the code snippet?
It seems that you are trying to display "_returnParam" after call to executeQueryAsync method. As executeQueryAsync is asychronous in nature, it returns immediately and executes statement to display "_returnParam" which is not defined as success handler is not executed.
The first anonymous function inside executeQueryAsync parameters is a success handler. So if asynchronous call succeeds, it will execute that function and initialize "_returnParams". Asynchronous call takes time to execute and does not block code execution (_returnParam remains un-initialized/undefined). So statement following async call executes and displays undefined.
Asynchronous call should not be followed by any statement which is manipulating object to be initialized by the async success/failure handlers.
Pradip T. ------------- MCTS(SharePoint 2010/Web)|MCPD(Web Development) https://www.mcpvirtualbusinesscard.com/VBCServer/paddytakate/profile
No comments:
Post a Comment