GetGlobalVariable not working in JavaScript - SOLVED

var dirs = exeoutput.GetGlobalVariable( ‘directories’, “”);
alert(dirs);

always returns undefined.

exeoutput.SetGlobalVariable works fine in JS. Example:

exeoutput.SetGlobalVariable( ‘directories’, “”, true );

Saw this post: Exeoutput.SetGlobalVariable problem

where user said "exeoutput.SetGlobalVariable works in Javascript, but exeoutput.GetGlobalVariable does not work in Javascript

Is this true?

In ExeOutput 2, exeoutput.GetGlobalVariable is not the same as in ExeOutput 1 because the JavaScript model in CEF3 is different.
So your code here won’t work
var dirs = exeoutput.GetGlobalVariable( ‘directories’, “”);
alert(dirs);
We have a sample in the documentation and in the general demo that shows how this works now thanks to asynchronous callbacks: for instance, do this:

<script language="JavaScript">



function DemoCallback(content) {

alert(content);

 }    

</script>

<script language="JavaScript">

exeoutput.GetGlobalVariable( 'directories', '', DemoCallback);

</script>

Initially it was not working, but I then added the DefaultValueIfNotFound and all is good now.

exeoutput.GetGlobalVariable( ‘directories’, “”, DemoCallback);

Thanks