I have a CEWP referencing a text file in a document library that contains the following script. This works for alerts, but I am trying to use a document.write to display the results within the CEWP.
EDIT: Basically how can I set a value in a variable within the onSuccessMethod and return that back out of the functions to a global var? This would allow me to accomplish exactly what I am trying to do. If I simply try to create a global list this
var myOutput = loadScript();
and set this inside onSuccessMethod:
myOutput = "Welcome " + this._currentUser.get_title()); return myOutput;
...I can set an alert in the middle of the above and see that myOutput holds the message value perfectly, but myOuput outside of these functions still reflects undefined. I have tried initializing it first, passing/accepting var as param through scriptLoader and findUser, and a bunch of other simple things, but I fear there is something about this I am simply misunderstanding.
Any/all helps is greatly appreciated as always!